[binutils-gdb] [gdb/testsuite] Handle wrap mode unsupported in gdb.tui/wrap-line.exp

Tom de Vries vries@sourceware.org
Fri Sep 26 23:21:13 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=756236557ba0397f2efe8d533df4ab04d939b025

commit 756236557ba0397f2efe8d533df4ab04d939b025
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat Sep 27 01:20:56 2025 +0200

    [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 <tom@tromey.com>

Diff:
---
 gdb/testsuite/gdb.tui/wrap-line.exp | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

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 {


More information about the Gdb-cvs mailing list