This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Flipping ifelse.exp test


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]