From: Tom de Vries Date: Fri, 26 Sep 2025 23:20:56 +0000 (+0200) Subject: [gdb/testsuite] Handle wrap mode unsupported in gdb.tui/wrap-line.exp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=756236557ba0397f2efe8d533df4ab04d939b025;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Handle wrap mode unsupported in gdb.tui/wrap-line.exp When running test-case gdb.tui/wrap-line.exp on msys2-ucrt64, we run into some fails in the CLI part of the test-case because: ... (gdb) maint info screen ... Readline wrapping mode: unsupported (terminal is not Cursor Up capable) ... Fix this by requiring wrapping mode "readline" for that part of the test-case. Tested on x86_64-linux and msys2-ucrt64. Approved-By: Tom Tromey --- diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp index 03c57b0c1f7..67ad36cbd25 100644 --- a/gdb/testsuite/gdb.tui/wrap-line.exp +++ b/gdb/testsuite/gdb.tui/wrap-line.exp @@ -104,29 +104,35 @@ proc test_wrap_cli_tui { auto_detected_width } { set re1 "Number of characters gdb thinks are in a line is ($::decimal)\\." set re2 \ "Number of characters readline reports are in a line is ($::decimal)\\." + set re3 \ + "Readline wrapping mode: (\[a-z\]+) \[\^\r\n]*" set cmd "maint info screen" set re \ [multi_line \ "^$re1" \ $re2 \ - ".*"] + ".*" \ + $re3] gdb_test_multiple $cmd "" { -re -wrap $re { set gdb_width $expect_out(1,string) set readline_width $expect_out(2,string) + set wrapping_mode $expect_out(3,string) pass $gdb_test_name } } - gdb_assert { $gdb_width == $::cols } "width" + if { $wrapping_mode == "readline" } { + gdb_assert { $gdb_width == $::cols } "width" - # TERM=ansi, so readline hides the last column. - gdb_assert { $gdb_width == [expr $readline_width + 1] } + # TERM=ansi, so readline hides the last column. + gdb_assert { $gdb_width == [expr $readline_width + 1] } - with_test_prefix cli { - set wrap_width $readline_width + with_test_prefix cli { + set wrap_width $readline_width - test_wrap $wrap_width 0 + test_wrap $wrap_width 0 + } } with_test_prefix tui {