This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] gdb.cp/static-print-quit.exp: fix racy tests (PR testsuite/12649)
- From: Marek Polacek <mpolacek at redhat dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 05 May 2011 20:12:07 +0200
- Subject: Re: [RFC] gdb.cp/static-print-quit.exp: fix racy tests (PR testsuite/12649)
- References: <4DC2E674.1060608@redhat.com>
I should have add a diff as well, here it is:
diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp
index b6e34aa..4bede4e 100644
--- a/gdb/testsuite/gdb.cp/static-print-quit.exp
+++ b/gdb/testsuite/gdb.cp/static-print-quit.exp
@@ -31,13 +31,27 @@ gdb_test_no_output "set width 80"
gdb_test_no_output "set height 2"
set test "print c"
+set seen_return 0
gdb_test_multiple $test $test {
- -re " = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type <return> to continue, or q <return> to quit---$" {
- pass $test
+ "<return>" {
+ incr seen_return
+ exp_continue
+ }
+ -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type " {
+ incr seen_return
+ exp_continue
+ }
+ -re " to continue, or q " {
+ incr seen_return
+ exp_continue
}
-re " to quit---$" {
- fail $test
- return -1
+ if { $seen_return >= 2 } {
+ pass $test
+ } else {
+ fail $test
+ return -1
+ }
}
}