diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-02-20 21:03:05 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-02-20 21:03:05 +0000 |
commit | 35dc4a6b96a61a6644d76d358f99eb6c50bae7d2 (patch) | |
tree | 0f318d1e4cd41873003c9b8b292ca1387d1bfbcb | |
parent | 24c79950cf07547970d2d41f0f20c0248c7c9808 (diff) | |
download | gdb-35dc4a6b96a61a6644d76d358f99eb6c50bae7d2.zip gdb-35dc4a6b96a61a6644d76d358f99eb6c50bae7d2.tar.gz gdb-35dc4a6b96a61a6644d76d358f99eb6c50bae7d2.tar.bz2 |
gdb/testsuite/
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.
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/inferior-died.c | 1 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/inferior-died.exp | 17 |
3 files changed, 25 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a7235a6..133bc26 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -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 diff --git a/gdb/testsuite/gdb.base/inferior-died.c b/gdb/testsuite/gdb.base/inferior-died.c index b3a97ae..ce9dcea 100644 --- a/gdb/testsuite/gdb.base/inferior-died.c +++ b/gdb/testsuite/gdb.base/inferior-died.c @@ -33,4 +33,5 @@ int main() function (); else waitpid (child, NULL, 0); + return 0; } diff --git a/gdb/testsuite/gdb.base/inferior-died.exp b/gdb/testsuite/gdb.base/inferior-died.exp index 458dd61..976a14f 100644 --- a/gdb/testsuite/gdb.base/inferior-died.exp +++ b/gdb/testsuite/gdb.base/inferior-died.exp @@ -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" |