From 592995fadd37e3a8d831fc3f48994c9d5cc2a974 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 16 Dec 2020 21:32:59 +0100 Subject: [PATCH] [gdb/testsuite] Fix prompt regexp in batch-preserve-term-settings.exp On openSUSE Leap 15.2, when running test-case gdb.base/batch-preserve-term-settings.exp I get: ... spawn /bin/sh^M PS1="gdb-subshell$ "^M sh-4.4$ PS1="gdb-subshell$ "^M gdb-subshell$ PASS: gdb.base/batch-preserve-term-settings.exp: batch run: \ spawn shell ... but on Ubuntu 18.04.5, I get instead: ... spawn /bin/sh^M PS1="gdb-subshell$ "^M $ gdb-subshell$ FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: \ spawn shell (timeout) ... Fix this by making the regexp recognize the second pattern as well. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-12-16 Tom de Vries * gdb.base/batch-preserve-term-settings.exp: --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/batch-preserve-term-settings.exp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 51d768c0365..3a7fc0c9030 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-12-16 Tom de Vries + + * gdb.base/batch-preserve-term-settings.exp: + 2020-12-16 Tom de Vries * lib/gdb.exp (gdb_compile_shlib_1): Factor out of ... diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp index c39d638aeb1..3e35d20dd75 100644 --- a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp +++ b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp @@ -47,7 +47,7 @@ proc spawn_shell {} { set gotit 0 set test "spawn shell" gdb_expect { - -re "PS1=\[^\r\n\]*\r\n$shell_prompt_re$" { + -re "PS1=\[^\r\n\]*\r\n.*$shell_prompt_re$" { pass $test set gotit 1 } -- 2.30.2