From b96cac16078d282ee0924296817c6eee52196669 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 21 Jun 2023 16:16:50 +0200 Subject: [PATCH] [gdb/testsuite] Fix gdb.tui/wrap-line.exp PR testsuite/30458 reports the following FAIL: ... PASS: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap ^CQuit (gdb) WARNING: timeout in accept_gdb_output Screen Dump (size 50 columns x 24 rows, cursor at column 6, row 3): 0 Quit 1 (gdb) 7890123456789012345678901234567890123456789 2 W^CQuit 3 (gdb) ... FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap ... The problem is that the regexp doesn't account for the ^C: ... gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap" ... The ^C occurs occasionally. This is something we'd like to fix. It's reported as a readline problem here ( https://lists.gnu.org/archive/html/bug-readline/2023-06/msg00000.html ). For now, fix this by updating the regexp, and likewise in another place in the test-case where we use ^C. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30458 --- gdb/testsuite/gdb.tui/wrap-line.exp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp index 2f0e4a5e795..1aac6fa69f6 100644 --- a/gdb/testsuite/gdb.tui/wrap-line.exp +++ b/gdb/testsuite/gdb.tui/wrap-line.exp @@ -25,6 +25,12 @@ set cols 50 set lines 24 set dims [list $lines $cols] +# Sometimes we see ^C. This is something we'd like to fix. It's reported as +# a readline problem here ( +# https://lists.gnu.org/archive/html/bug-readline/2023-06/msg00000.html ). +# For now, ignore it. +set re_control_c "(\\^C)?Quit" + # Fill line, assuming we start after the gdb prompt. proc fill_line { width } { set res "" @@ -47,7 +53,7 @@ proc fill_line { width } { proc test_wrap { wrap_width } { # Generate a prompt and parse it. send_gdb "\003" - gdb_assert { [Term::wait_for "(^|$::gdb_prompt )Quit"] } "start line" + gdb_assert { [Term::wait_for "(^|$::gdb_prompt )$::re_control_c"] } "start line" # Fill the line to just before wrapping. set str [fill_line $wrap_width] @@ -64,7 +70,7 @@ proc test_wrap { wrap_width } { # Generate a prompt and parse it. send_gdb "\003" - gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap" + gdb_assert { [Term::wait_for "^W$::re_control_c"] } "prompt after wrap" } # Test wrapping in both CLI and TUI. -- 2.30.2