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: [RFC] gdb.cp/static-print-quit.exp: fix racy tests (PR testsuite/12649)


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
+       }
     }
 }
 


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