aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-06-07 14:33:50 +0200
committerTom de Vries <tdevries@suse.de>2021-06-07 14:33:50 +0200
commitbc37aacde189cbebffd06b5459b239a0407de396 (patch)
tree0763fdc8af8dce2725ade458669cba7ae390d7a7
parent7ee8c127555c89781bcd9451cdea54884f6ac155 (diff)
downloadbinutils-bc37aacde189cbebffd06b5459b239a0407de396.zip
binutils-bc37aacde189cbebffd06b5459b239a0407de396.tar.gz
binutils-bc37aacde189cbebffd06b5459b239a0407de396.tar.bz2
[gdb/testsuite] Fix gdb.base/new-ui-pending-input.exp timeout
With a testsuite setup modified to make expect wait a little bit longer for gdb output (see PR27957), I run into: ... PASS: gdb.base/new-ui-pending-input.exp: spawn gdb print 1^M print 2^M print 3^M (gdb) $1 = 1^M (gdb) $2 = 2^M (gdb) $3 = 3^M (gdb) PASS: gdb.base/new-ui-pending-input.exp: initial prompt on extra console ^M Breakpoint 1, main () at new-ui-pending-input.c:25^M 25 return 0; /* set breakpoint here */^M FAIL: gdb.base/new-ui-pending-input.exp: print 1 on extra console (timeout) ... Usually, I get a pass instead. In the passing case, the "initial prompt" PASS is after the first prompt: ... PASS: gdb.base/new-ui-pending-input.exp: spawn gdb print 1^M print 2^M print 3^M (gdb) PASS: gdb.base/new-ui-pending-input.exp: initial prompt on extra console ... while in the failing case, that PASS is after the fourth prompt. The regexp doesn't match the first prompt because it terminates with a '$': ... -re "$gdb_prompt $" { ... Fix this by removing the terminating '$' and prefixing the regex with something unique to the first prompt: "print 3". Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries <tdevries@suse.de> * gdb.base/new-ui-pending-input.exp (test_command_line_new_ui_pending_input): Fix regexp for "initial prompt on extra console".
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/new-ui-pending-input.exp2
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1607a0d..fb70c0f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2021-06-07 Tom de Vries <tdevries@suse.de>
+ * gdb.base/new-ui-pending-input.exp
+ (test_command_line_new_ui_pending_input): Fix regexp for "initial
+ prompt on extra console".
+
+2021-06-07 Tom de Vries <tdevries@suse.de>
+
* gdb.base/info-types.exp.tcl (run_test): Move "random line" regexp
up.
diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp
index 09e10f9..4853f95 100644
--- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp
+++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp
@@ -77,7 +77,7 @@ proc test_command_line_new_ui_pending_input {} {
with_spawn_id $extra_spawn_id {
set test "initial prompt on extra console"
gdb_test_multiple "" $test {
- -re "$gdb_prompt $" {
+ -re "\r\nprint 3\r\n$gdb_prompt " {
pass $test
}
}