]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.tui/basic.exp for TERM=ansis
authorTom de Vries <tdevries@suse.de>
Fri, 8 Aug 2025 11:51:00 +0000 (13:51 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 8 Aug 2025 11:51:00 +0000 (13:51 +0200)
With test-case gdb.tui/basic.exp and TERM=ansis, I run into (with some logging
added):
...
status line: '<reverse:1><intensity:dim>exec No process (asm) In:
             L??   PC: ?? <reverse:0><intensity:normal>'
FAIL: gdb.tui/basic.exp: status window: reverse
...

The status window uses ncurses attribute standout, which can differ between
different terminal settings.

Fix this by making the matching less strict.

Tested on x86_64-linux.

gdb/testsuite/gdb.tui/basic.exp

index 35c99bd6315809f5ae4f44a899769cee87efeab6..48b90dabbf2a9a6c1788e655e59d488f015f81b3 100644 (file)
@@ -112,5 +112,9 @@ set re_noattr "\[^<\]"
 set status_window_line 15
 
 set status [Term::get_line_with_attrs $status_window_line]
-gdb_assert { [regexp "^<reverse:1>$re_noattr*<reverse:0>$" $status] == 1} \
+verbose -log "status line: '$status'"
+
+# The status line uses standout, which may translate to different attributes
+# depending on the terminal settings.  Just check for at least one attribute.
+gdb_assert { [regexp "^<.*>exec" $status] == 1 } \
     "status window: reverse"