aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2018-09-03 16:14:55 +0100
committerGary Benson <gbenson@redhat.com>2018-09-04 15:29:20 +0100
commitdd083ee23d23903e8bc595b64aa8ea62379491cd (patch)
treee0092e594586d6d1f5b7d19c32df98d06a4d903b
parent618a8fdba6fc86a6ed88df257bf5f44d85e9071b (diff)
downloadgdb-dd083ee23d23903e8bc595b64aa8ea62379491cd.zip
gdb-dd083ee23d23903e8bc595b64aa8ea62379491cd.tar.gz
gdb-dd083ee23d23903e8bc595b64aa8ea62379491cd.tar.bz2
Fix batch exit status test failure on Fedora 28
This commit adds calls to remote_close and clear_gdb_spawn_id to gdb.base/batch-exit-status.exp, fixing failures reported by buildbot on Fedora 28 where gdb_spawn_id not being reset by the previous test caused default_gdb_spawn to return without spawning. This commit also changes the test to use detect GDB's exit using gdb_test_multiple expecting 'eof', rather than using 'wait -i' alone. This means the testcase won't hang forever on failure as fixed in gdb.base/quit.exp by commit 15763a09d4ae ("Fix 'gdb.base/quit.exp hangs forever' if the test fails"). gdb/testsuite/ChangeLog: * gdb.base/batch-exit-status.exp: Use gdb_test_multiple and expect 'eof' before 'wait -i'. Use remote_close and clear_gdb_spawn_id.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/batch-exit-status.exp17
2 files changed, 17 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 91ab0da..79e57fc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-09-04 Gary Benson <gbenson@redhat.com>
+
+ * gdb.base/batch-exit-status.exp: Use gdb_test_multiple and expect
+ 'eof' before 'wait -i'. Use remote_close and clear_gdb_spawn_id.
+
2018-08-31 Tom Tromey <tom@tromey.com>
* gdb.rust/simple.rs: Rename second variable "v".
diff --git a/gdb/testsuite/gdb.base/batch-exit-status.exp b/gdb/testsuite/gdb.base/batch-exit-status.exp
index bee4d72..3b5de59 100644
--- a/gdb/testsuite/gdb.base/batch-exit-status.exp
+++ b/gdb/testsuite/gdb.base/batch-exit-status.exp
@@ -29,11 +29,18 @@ proc _test_exit_status {expect_status cmdline_opts} {
return
}
- set result [wait -i $gdb_spawn_id]
- verbose $result
- gdb_assert { [lindex $result 2] == 0 }
- set actual_status [lindex $result 3]
- gdb_assert { $actual_status == $expect_status }
+ gdb_test_multiple "" "run til exit" {
+ eof {
+ set result [wait -i $gdb_spawn_id]
+ verbose $result
+
+ gdb_assert { [lindex $result 2] == 0 }
+ gdb_assert { [lindex $result 3] == $expect_status }
+
+ remote_close host
+ clear_gdb_spawn_id
+ }
+ }
}
proc test_exit_status {expect_status cmdline_opts} {