This is the mail archive of the gdb-patches@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: [rfa] gdb.base/volatile.exp / varargs.exp: replace send_gdb with gdb_test


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


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