Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fred Fish <fnf@specifix.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] Handle output after 'Program exited normally' consistently (detect spurious output)
Date: Thu, 11 May 2006 14:39:00 -0000	[thread overview]
Message-ID: <200605111039.54405.fnf@specifix.com> (raw)
In-Reply-To: <200605110709.11444.fnf@specifix.com>

On Thursday 11 May 2006 07:09, Fred Fish wrote:
> If we care about testing for cruft between the exit message and the
> gdb prompt, to specifically catch that case, then I think that should
> have it's own dedicated testcase, which I'm happy to write and submit.

I modified the a2-run.exp test to allow it to run the part of the test that
doesn't require being able to pass arguments, and detect spurious output
after the program exits normally.  Patch below.

-Fred

  2006-05-11  Fred Fish  <fnf@specifix.com>
  
 	* gdb.base/a2-run.exp: Allow part of test to run when args aren't
 	required.  Check for spurious output after program exits normally.
 
Index: gdb.base/a2-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/a2-run.exp,v
retrieving revision 1.5
diff -c -p -r1.5 a2-run.exp
*** gdb.base/a2-run.exp	7 May 2002 00:45:44 -0000	1.5
--- gdb.base/a2-run.exp	11 May 2006 14:37:50 -0000
***************
*** 20,32 ****
  
  # This file was written by Rob Savoye. (rob@cygnus.com)
  
- # These tests don't work for targets can't take arguments...
- 
- if [target_info exists noargs] then {
-     verbose "Skipping a2-run.exp because of noargs."
-     return
- }
- 
  # Can't do this test without stdio support.
  if [gdb_skip_stdio_test "a2run.exp"] {
      return
--- 20,25 ----
*************** if [istarget "*-*-vxworks*"] then {
*** 77,87 ****
--- 70,90 ----
      gdb_expect -re "$gdb_prompt $" {}
  } else {
      gdb_expect {
+ 	-re ".*usage:  factorial <number>.*Program exited with code 01\.\r\n$gdb_prompt $" {
+ 	    pass "run \"$testfile\" with no args"
+ 	    pass "no spurious messages at program exit"
+ 	}
  	-re ".*usage:  factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
  	    pass "run \"$testfile\" with no args"
+ 	    fail "no spurious messages at program exit"
+ 	}
+ 	-re ".*usage:  factorial <number>.* EXIT code 1.*Program exited normally\.\r\n$gdb_prompt $" {
+ 	    pass "run \"$testfile\" with no args (exit wrapper)"
+ 	    pass "no spurious messages at program exit"
  	}
  	-re ".*usage:  factorial <number>.* EXIT code 1.*Program exited normally.*$gdb_prompt $" {
  	    pass "run \"$testfile\" with no args (exit wrapper)"
+ 	    fail "no spurious messages at program exit"
  	}
  	-re ".*$gdb_prompt $" {
  	    fail "run \"$testfile\" with no args"
*************** if [istarget "*-*-vxworks*"] then {
*** 92,97 ****
--- 95,108 ----
  	}
      }
  }
+ 
+ # The remaining tests don't work for targets can't take arguments...
+ 
+ if [target_info exists noargs] then {
+     verbose "Skipping rest of a2-run.exp because of noargs."
+     return
+ }
+ 
  # Now run with some arguments
  if [istarget "*-*-vxworks*"] then {
      send_gdb "run vxmain \"5\"\n"


  parent reply	other threads:[~2006-05-11 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-11 11:08 [RFA] Handle output after 'Program exited normally' consistently Fred Fish
2006-05-11 12:39 ` Daniel Jacobowitz
2006-05-11 14:39 ` Fred Fish [this message]
2006-05-15 15:57   ` [RFA] Handle output after 'Program exited normally' consistently (detect spurious output) Daniel Jacobowitz
2006-05-18  0:07     ` Fred Fish
2006-05-18  3:15       ` Daniel Jacobowitz
2006-05-11 17:34 ` [RFA] Handle output after 'Program exited normally' consistently PAUL GILLIAM
2006-05-12 20:33 ` Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605111039.54405.fnf@specifix.com \
    --to=fnf@specifix.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox