diff options
author | Tom de Vries <tdevries@suse.de> | 2023-05-05 12:20:20 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-05-05 12:20:20 +0200 |
commit | c2a0fca06af371adc360c2da6bafc23651e5761e (patch) | |
tree | 541b4c3c47264e9d2ea4cc66f1b9eac8a4a55b4c /gdb/testsuite/lib/tuiterm.exp | |
parent | e4fbcd83c2423221ddde99d50b432df7dda06f5f (diff) | |
download | gdb-c2a0fca06af371adc360c2da6bafc23651e5761e.zip gdb-c2a0fca06af371adc360c2da6bafc23651e5761e.tar.gz gdb-c2a0fca06af371adc360c2da6bafc23651e5761e.tar.bz2 |
[gdb/testsuite] Add gdb.tui/wrap-line.exp
Add a test-case that tests prompt edit wrapping behaviour in the tuiterm, both
for CLI and TUI, both with auto-detected and hard-coded width.
In the CLI case with auto-detected width we run into PR cli/30411, so add a
KFAIL for that failure mode.
Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/lib/tuiterm.exp')
-rw-r--r-- | gdb/testsuite/lib/tuiterm.exp | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 8f78c32..5e4235d 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -788,26 +788,37 @@ namespace eval Term { return 1 } - # Like ::clean_restart, but ensures that gdb starts in an - # environment where the TUI can work. ROWS and COLS are the size - # of the terminal. EXECUTABLE, if given, is passed to - # clean_restart. - proc clean_restart {rows cols {executable {}}} { + # Setup the terminal with dimensions ROWSxCOLS, TERM=ansi, and execute + # BODY. + proc with_tuiterm {rows cols body} { global env stty_init - save_vars {env(TERM) stty_init ::GDBFLAGS} { + save_vars {env(TERM) stty_init} { setenv TERM ansi _setup $rows $cols - # Make GDB not print the directory names. Use this setting to - # remove the differences in test runs due to varying directory - # names. - append ::GDBFLAGS " -ex \"set filename-display basename\"" + uplevel $body + } + } - if {$executable == ""} { - ::clean_restart - } else { - ::clean_restart $executable + # Like ::clean_restart, but ensures that gdb starts in an + # environment where the TUI can work. ROWS and COLS are the size + # of the terminal. EXECUTABLE, if given, is passed to + # clean_restart. + proc clean_restart {rows cols {executable {}}} { + with_tuiterm $rows $cols { + save_vars { ::GDBFLAGS } { + # Make GDB not print the directory names. Use this setting to + # remove the differences in test runs due to varying directory + # names. + append ::GDBFLAGS " -ex \"set filename-display basename\"" + + if {$executable == ""} { + ::clean_restart + } else { + ::clean_restart $executable + } } + ::gdb_test_no_output "set pagination off" } } |