[gdb/testsuite] Fix prompt regexp in batch-preserve-term-settings.exp
authorTom de Vries <tdevries@suse.de>
Wed, 16 Dec 2020 20:32:59 +0000 (21:32 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 16 Dec 2020 20:32:59 +0000 (21:32 +0100)
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  <tdevries@suse.de>

* gdb.base/batch-preserve-term-settings.exp:

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/batch-preserve-term-settings.exp

index 51d768c036595208c64f0cf59062a121e505279a..3a7fc0c9030242a9225d0a69500c0b79c5b7dd7e 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-16  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.base/batch-preserve-term-settings.exp:
+
 2020-12-16  Tom de Vries  <tdevries@suse.de>
 
        * lib/gdb.exp (gdb_compile_shlib_1): Factor out of ...
index c39d638aeb10fa2922c993c35f46739e0ee58cce..3e35d20dd7518197c433525d76da45250d04d988 100644 (file)
@@ -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
        }