[gdb/testsuite] Handle shell prompt in batch-preserve-term-settings.exp
authorTom de Vries <tdevries@suse.de>
Mon, 14 Dec 2020 16:05:11 +0000 (17:05 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 14 Dec 2020 16:05:11 +0000 (17:05 +0100)
commit153f6e6cb0266f8312ba85956b256ce1e3a2cb8e
tree4d92f28fef3f71b04138035c6befe7f2ce2cdf2d
parent86b442599bca468f997a3f1f58cba68b752ef6b2
[gdb/testsuite] Handle shell prompt in batch-preserve-term-settings.exp

On SLE-11, I run into:
...
FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: spawn shell \
  (timeout)
...

The problem is that the shell prompt has PS1="\h:\w> ", but the test expects
a shell prompt ending in a space preceded by either '$' or '#':
...
set shell_prompt_re "\[$#\] "
...

We could easily fix this by adding '>' to shell_prompt_re, but this wouldn't
work for other PS1 setting.

Fix this instead by setting the shell prompt to "gdb-subshell$ " (as in
gdb.base/multi-line-starts-subshell.exp).

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-12-14  Tom de Vries  <tdevries@suse.de>

PR testsuite/26951
* gdb.base/batch-preserve-term-settings.exp: Use "gdb-subshell$ " as
shell prompt.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/batch-preserve-term-settings.exp