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_expect -> gdb_test_multiple for filesym.exp


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.

Ok?
Keith

2013-05-16  Keith Seitz  <keiths@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	16 May 2013 20:39:05 -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 "m\$" {
+	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 ".*filesym\[ \t\]+filesym.c.*$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

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