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: Keith Seitz <keiths at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Mon, 20 May 2013 12:14:12 -0700
- 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> <51960BCD dot 7070404 at redhat dot com>
On 05/17/2013 03:51 AM, Pedro Alves wrote:
As long as we're revising... :-)
Sure!
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"
}
}
}
}
I've used this verbatim and tested with the read1 scenario, too. All
looks good.
Keith
ChangeLog
2013-05-20 Keith Seitz <keiths@redhat.com>
Pedro Alves <palves@redhat.com>
* gdb.base/filesym.exp: Use gdb_test_multiple instead of
gdb_expect.
Add test to flush the remaining input buffer so that this
file passes testsuite/12649.
Index: testsuite/gdb.base/filesym.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/filesym.exp,v
retrieving revision 1.1
diff -u -p -r1.1 filesym.exp
--- testsuite/gdb.base/filesym.exp 15 May 2013 21:21:05 -0000 1.1
+++ testsuite/gdb.base/filesym.exp 20 May 2013 19:11:51 -0000
@@ -26,25 +26,26 @@ if {[prepare_for_testing $testfile.exp $
# complete to "filesym"; completing again, we expect the symbol name and the
# filename (in that order).
+set tst "complete on \"filesy\""
send_gdb "break filesy\t"
-gdb_expect {
- -re "m\$" {
- pass "complete on \"filesy\""
+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_expect {
- -re ".*filesym\[ \t\]+filesym.c.*$gdb_prompt break filesym\$" {
- pass "completion list for \"filesym\""
- }
+ gdb_test_multiple "" $tst {
+ -re "\\\x07\r\nfilesym\[ \t\]+filesym.c\[ \t\]+\r\n$gdb_prompt " {
+ pass $tst
- default {
- fail "completion list for \"filesym\""
+ # 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"
}
}
}
-
- default {
- fail "complete on \"filesy\""
- }
}
+
+unset -nocomplain tst