This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Flipping ifelse.exp test
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb at sourceware dot org
- Date: Mon, 17 Jul 2006 19:40:35 -0400
- Subject: Re: Flipping ifelse.exp test
- References: <200607172302.k6HN2mlx002514@elgar.sibelius.xs4all.nl>
On Tue, Jul 18, 2006 at 01:02:48AM +0200, Mark Kettenis wrote:
>
> (gdb) if 1
> >end
> (gdb) FAIL: gdb.base/ifelse.exp: if 1 with empty body
> echo got here\n
> got here
> (gdb) PASS: gdb.base/ifelse.exp: if 0 with empty body
>
> I fail to see what's wrong with the test though. The regular
> expressions seem to be properly anchored.
>
> Can anyone spot the problem?
Yes. The default pattern in gdb_test_multiple is anchored by
"$gdb_prompt $", which occurs (if you're unlucky with buffering)
right in the middle of this test.
Basically you can't do a test that requires two gdb prompts.
I'd recommend removing the "echo got_here" from that test and the other
similar ones. Another thing that might work would be an explicit
anchored pattern to catch the first gdb prompt and continue, below the
pass pattern, but that's prone to timeouts if something goes wrong..
--
Daniel Jacobowitz
CodeSourcery