This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] gdb_expect -> gdb_test_multiple for filesym.exp
- From: Pedro Alves <palves at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Fri, 17 May 2013 11:51:57 +0100
- Subject: Re: [RFA] gdb_expect -> gdb_test_multiple for filesym.exp
- References: <51951EAC dot 9090607 at redhat dot com> <51952C91 dot 5040605 at redhat dot com> <51952E71 dot 90601 at redhat dot com> <51953173 dot 70002 at redhat dot com> <5195440D dot 6070601 at redhat dot com>
On 05/16/2013 09:39 PM, Keith Seitz wrote:
> On 05/16/2013 12:20 PM, Pedro Alves wrote:
>> On 05/16/2013 08:07 PM, Keith Seitz wrote:
>>
>>> It can be easily removed, if you wished. Just let me know.
>>
>> It's fine with me as is.
>
> Actually, I'm revising this test a tiny bit. Jan mentioned privately that this test was failing the read1 test scenario (see testsuite/12649). With this update, the patch now passes that, too.
Ah, missed that indeed.
As long as we're revising... :-)
> +set tst "complete on \"filesy\""
> send_gdb "break filesy\t"
> -gdb_expect {
> - -re "m\$" {
> - pass "complete on \"filesy\""
> +gdb_test_multiple "" $tst {
> + -re "m\$" {
> + pass $tst
IMO, \t completion tests should check the whole expected line.
That's because '-re "m' matches anything before that "m".
So, say, this plausible bug where we'd complete the whole word instead
of just the missing letter
"break filesy\t" -> "break filesyfilesym"
would go unnoticed.
That's how the tests in completion.exp work too.
>
> # Now ask for the completion list
> + set tst "completion list for \"filesym\""
> send_gdb "\t\t"
> - gdb_expect {
> - -re ".*filesym\[ \t\]+filesym.c.*$gdb_prompt break filesym\$" {
> - pass "completion list for \"filesym\""
> - }
> + gdb_test_multiple "" $tst {
> + -re ".*filesym\[ \t\]+filesym.c.*$gdb_prompt " {
> + pass $tst
Likewise, this would accept 3 or more entries, as long as
the expect 2 are there.
IOW, here's what IMO the test should end up like.
set tst "complete on \"filesy\""
send_gdb "break filesy\t"
gdb_test_multiple "" $tst {
-re "^break filesy\\\x07m" {
pass $tst
# Now ask for the completion list
set tst "completion list for \"filesym\""
send_gdb "\t\t"
gdb_test_multiple "" $tst {
-re "\\\x07\r\nfilesym\[ \t\]+filesym.c\[ \t\]+\r\n$gdb_prompt " {
pass $tst
# Flush the rest of the output by creating the breakpoint.
# This ensures this file passes testsuite/12649.
send_gdb "\n"
gdb_test "" "Breakpoint 1.*" "set breakpoint at filesym"
}
}
}
}
--
Pedro Alves