This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfa] gdb.base/volatile.exp / varargs.exp: replace send_gdb with gdb_test
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>, Michael Snyder <msnyder at vmware dot com>
- Date: Thu, 20 May 2010 17:24:42 +0100
- Subject: Re: [rfa] gdb.base/volatile.exp / varargs.exp: replace send_gdb with gdb_test
- References: <4BF4497E.9040209@vmware.com> <20100520155010.GA3019@adacore.com>
On Thursday 20 May 2010 16:50:10, Joel Brobecker wrote:
> > +gdb_test "set print sevenbit-strings" ""
> > +gdb_test "set print address off" ""
> > +gdb_test "set width 0" ""
>
> You actually don't need to specify the second argument if it's empty,
> but I think it's good practice to do so, just to show that we do indeed
> expect the command to produce no output. The fact that we cannot
> currently verify that is a bit unfortunate, but at least the above
> expresses it at the testsuite level...
>
You can anchor the output with gdb_test_multiple. This, for example,
checks that a command produces no output other than the prompt:
set cmd "..."
set msg "..."
set cmd_regex [string_to_regexp $cmd]
gdb_test_multiple $cmd $msg {
-re "^$cmd_regex\r\n$gdb_prompt $" {
pass $msg
}
}
something like this is used in several places in the
testsuite. we could perhaps add a wrapper in gdb.exp.
--
Pedro Alves