gdb/testsuite/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 20 Feb 2012 21:03:05 +0000 (21:03 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 20 Feb 2012 21:03:05 +0000 (21:03 +0000)
Fix racy FAILs.
* gdb.base/inferior-died.c (main): Add return of 0.
* gdb.base/inferior-died.exp (continue): Fix expectation of
asynchronous events.
(p 1): New test.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/inferior-died.c
gdb/testsuite/gdb.base/inferior-died.exp

index a7235a683640dc584faa0214c979e3ad4ac48cce..133bc26df04df81fbb47ce97ba2aab9ab847e1d7 100644 (file)
@@ -1,3 +1,11 @@
+2012-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix racy FAILs.
+       * gdb.base/inferior-died.c (main): Add return of 0.
+       * gdb.base/inferior-died.exp (continue): Fix expectation of
+       asynchronous events.
+       (p 1): New test.
+
 2012-02-20  Pedro Alves  <palves@redhat.com>
 
        * gdb.threads/attach-into-signal.exp (corefunc): Don't enable
index b3a97ae5250f717f8ed7cdc2fc75869174bb6bbd..ce9dcea8e31e0f62380ecc6ffc74b045dbc990a5 100644 (file)
@@ -33,4 +33,5 @@ int main()
     function ();
   else
     waitpid (child, NULL, 0);
+  return 0;
 }
index 458dd613b95e462c1dfcbac0a475456827279e1b..976a14f33962cc4f40cbbbb9a5e29b628df960f0 100644 (file)
@@ -53,4 +53,19 @@ gdb_breakpoint $srcfile:$line
 gdb_continue_to_breakpoint "breakpoint"
 
 gdb_test "inferior 2" "Switching to inferior 2.*"
-gdb_test "continue" "exited normally.*"
+
+# The inferior 1 exit may come unexpectedly in any moment.
+set test "continue"
+set seen 0
+gdb_test_multiple $test $test {
+    -re "($gdb_prompt |\\\[Inferior \[^\r\n\]* exited normally\\\])" {
+       incr seen
+       if {$seen < 3} {
+           exp_continue
+       }
+       pass $test
+    }
+}
+
+# Internal error may show up after all the messages above.
+gdb_test "p 1" " = 1"