]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Handle wrap mode unsupported in gdb.tui/wrap-line.exp
authorTom de Vries <tdevries@suse.de>
Fri, 26 Sep 2025 23:20:56 +0000 (01:20 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 26 Sep 2025 23:20:56 +0000 (01:20 +0200)
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 <tom@tromey.com>
gdb/testsuite/gdb.tui/wrap-line.exp

index 03c57b0c1f71555b7b9ac3976dbafce2c19a1b6e..67ad36cbd25b46203d8e39d55b6dfb17c1ead3ae 100644 (file)
@@ -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 {