This is the mail archive of the gdb-patches@sources.redhat.com 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/testsuite] Re: RFC: gdb_test_multiple


Hi Daniel,

I am _much_ more comfortable with this version. Thanks for spending the time to get it into this format.

I believe Michael wanted to give it a spin, but otherwise I think it is ripe to be committed.

Thanks to Andrew and Michael for helping with comments. I was away and just came back yesterday.

Regards to all,
Fernando

Daniel Jacobowitz wrote:> On Mon, Jan 06, 2003 at 10:33:11PM -0600, Michael Elizabeth Chastain wrote:

OK.  I'll have an even easier version of this done tomorrow; it has one
truely gruesome TCL hack in it, but that's it.
I'd like to do another test spin on the new version before you commit
it if that's all right with you.  I can do a cut-down version but I'd
like to be really sure about sourceware dejagnu because the damn things
are subtly different, and I normally don't test with it.

Here's the version I'd like to include. I definitely need your
reaction to this patch, and Fernando's. I'd like anyone else's, too.
There's one quoting hack in it, but I don't think it's fragile.

This one is a lot more intuitive. You use it like this:

gdb_test_multiple $command $message {
-re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
if ![string match "" $message] then {
pass "$message"
}
}
-re "(${question_string})$" {
send_gdb "$response_string\n";
exp_continue;
}
}

There's no magic variable names any more. $pattern and $gdb_prompt in
this example get evaluated in the caller's context; the action blocks
get executed in the caller's context; and in general it behaves just
like expect ought to.

[That "\[\r\n\]*" is just there because it was previously in gdb_test. Bonus points to the astute reader who can figure out why it doesn't
need to be there. Presumably the _intent_ was to use "\[\r\n\]+", so
that $pattern needed to match an entire line, but our testsuite doesn't
honor that intent, so this is a question for another day.]

Fernando, Michael, how does this look? I think it will be useful.



--
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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