From: Pedro Alves <palves@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [RFA] gdb_expect -> gdb_test_multiple for filesym.exp
Date: Fri, 17 May 2013 10:52:00 -0000 [thread overview]
Message-ID: <51960BCD.7070404@redhat.com> (raw)
In-Reply-To: <5195440D.6070601@redhat.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
next prev parent reply other threads:[~2013-05-17 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 18:52 Keith Seitz
2013-05-16 18:59 ` Pedro Alves
2013-05-16 19:07 ` Keith Seitz
2013-05-16 19:20 ` Pedro Alves
2013-05-16 20:39 ` Keith Seitz
2013-05-17 10:52 ` Pedro Alves [this message]
2013-05-20 19:14 ` Keith Seitz
2013-05-21 0:18 ` Pedro Alves
2013-05-21 19:12 ` Keith Seitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51960BCD.7070404@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox