]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: force TERM setting for some filename completion tests
authorAndrew Burgess <aburgess@redhat.com>
Tue, 5 Nov 2024 17:26:13 +0000 (17:26 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 25 Nov 2024 11:54:42 +0000 (11:54 +0000)
commitc2baada0544688db0284a4896874cb5d589428eb
treed9986942aadb40fb4c9b785d542c7e29c114c9cc
parent7ffa83b32e8aeb840eccbcd934e947decc5544aa
gdb/testsuite: force TERM setting for some filename completion tests

Some of the filename completion tests perform mid-line completion.
That is we enter a partial line, then move the cursor back to the
middle of the line and perform completion.

The problem is that, emitting characters into the middle of a terminal
line relies on first emitting some control characters.  And which
control characters are emitted will depend on the current TERM
setting.

When I initially added the mid-line completion tests I setup two
regexp that covered two different terminal types, but PR gdb/32338
identifies additional terminal types that emit different sequences of
control characters.

Rather than trying to handle all possible terminal types, lets just
force the TERM variable to something simple (i.e. "dumb") and then
just support that one case.  The thing being tested for here was that
GDB would complete a filename in the middle of a line, the specific
terminal type was not really important.

I've simplified the regexp used to match the completion in two places,
and I now force TERM to be "dumb" for the mid-line completion tests.
I've tested this by setting my global environment TERM to 'ansi',
'xterm', 'xterm-mono', and 'dumb', and I see no failures in any mode
now.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32338
Tested-By: Tom de Vries <tdevries@suse.de>
gdb/testsuite/gdb.base/filename-completion.exp