This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFA/testsuite for "Re: Regression tester confusion"
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Geoff Keating <geoffk at redhat dot com>, Fernando Nasser <fnasser at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com,Michael Elizabeth Chastain <mec at shout dot net>
- Date: Tue, 7 May 2002 19:14:27 -0400
- Subject: RFA/testsuite for "Re: Regression tester confusion"
- References: <92880000.1020796022@gandalf.codesourcery.com> <200205071944.g47Ji5V14853@desire.geoffk.org> <20020507201308.GA28662@nevyn.them.org> <200205072246.g47MkxT15139@desire.geoffk.org>
On Tue, May 07, 2002 at 03:46:59PM -0700, Geoff Keating wrote:
> > Date: Tue, 7 May 2002 16:13:08 -0400
> > From: Daniel Jacobowitz <drow@mvista.com>
> ...
> > This usually means that the previous DejaGNU command did not explicitly
> > consume enough input... Although in this case, it looks as if there are
> > an invalid extra \r\n between the 'data's.
> >
> > The comment two tests up in interrupt.exp sounds as if there's a known
> > timing problem here. Did "call function when asleep" fail, causing the
> > extra newline to get sent?
>
> No---this was the first and only failure for interrupt.exp. This is a
> cross to mips-elf, running on the sim, so I think the comment doesn't apply.
>
> The log looks like (through 'cat -A', but may be word-wrapped, sorry):
>
> a^M$
> PASS: gdb.base/interrupt.exp: child process ate our char$
> ^M$
> Program received signal SIGINT, Interrupt.^M$
> 0xa0020298 in main () at
> /anubis/mummy/tbox/objs/share/gdb-testsuite/gdb.base/interrupt.c:17^M$
> 17^I nbytes = read (0, &x, 1);^M$
> (gdb) PASS: gdb.base/interrupt.exp: send_gdb control C$
> p func1 ()^M$
> $1 = 4^M$
> (gdb) PASS: gdb.base/interrupt.exp: call function when asleep$
> p func1 ()^M$
> $2 = 4^M$
> (gdb) PASS: gdb.base/interrupt.exp: call function a second time$
> continue^M$
> Continuing.^M$
> PASS: gdb.base/interrupt.exp: continue$
> data^M$
> ^M$
> data^M$
> FAIL: gdb.base/interrupt.exp: echo data (timeout)$
> end of file^M$
> ^M$
> Program exited normally.^M$
> [Switching to process 0]^M$
> Current language: auto; currently asm^M$
> (gdb) PASS: gdb.base/interrupt.exp: send end of file$
>
> When the test passes (as it did on the very next run), the output
> looks like:
>
> PASS: gdb.base/interrupt.exp: child process ate our char$
> ^M$
> Program received signal SIGINT, Interrupt.^M$
> 0xa0020298 in main () at
> /anubis/mummy/tbox/objs/share/gdb-testsuite/gdb.base/in
> terrupt.c:17^M$
> 17^I nbytes = read (0, &x, 1);^M$
> (gdb) PASS: gdb.base/interrupt.exp: send_gdb control C$
> p func1 ()^M$
> $1 = 4^M$
> (gdb) PASS: gdb.base/interrupt.exp: call function when asleep$
> p func1 ()^M$
> $2 = 4^M$
> (gdb) PASS: gdb.base/interrupt.exp: call function a second time$
> continue^M$
> Continuing.^M$
> ^M$
> PASS: gdb.base/interrupt.exp: continue$
> data^M$
> PASS: gdb.base/interrupt.exp: echo data$
> data^M$
> end of file^M$
>
> ... and now I see. The regexp is:
>
> -re "^(\r\n|)data\r\n(|data\r\n)$" { pass "echo data" }
>
> But in the failing case, we are getting
>
> data\r\n\r\ndata\r\n
>
> which doesn't match for some reason.
>
> I think the variation is because one 'data\r\n' is the tty driver
> echoing the test harness's input, and the program's output is
> '\r\ndata\r\n' (the first \r\n is from earlier). They are getting
> interleaved depending on system load.
OK. This first \r\n should be consumed earlier in the test, but for
now I'm perfectly willing to recognize it here. Fernando's on
vacation, but I seem to recall he delegated to Michael - if that's
right, is this patch acceptable?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2002-05-07 Daniel Jacobowitz <drow@mvista.com>
* gdb.base/interrupt.exp: Accept extra \r\n in another
possible location.
Index: interrupt.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/interrupt.exp,v
retrieving revision 1.4
diff -u -r1.4 interrupt.exp
--- interrupt.exp 29 Oct 2001 17:38:11 -0000 1.4
+++ interrupt.exp 7 May 2002 23:11:24 -0000
@@ -164,8 +164,11 @@
# FIXME: The pattern below leads to an expected success on HPUX-11.0
# but the success is spurious. Need to provide the right reg.expr.
# here.
+ # The second optional \r\n is for a similar reason; the interleaving
+ # varies depending on system load, etc. We should consume it
+ # above instead...
gdb_expect {
- -re "^(\r\n|)data\r\n(|data\r\n)$" { pass "echo data" }
+ -re "^(\r\n|)data\r\n(\r\n)?(|data\r\n)$" { pass "echo data" }
timeout { fail "echo data (timeout)" }
eof { fail "echo data (eof)" }
}