From: Tom de Vries Date: Fri, 26 Sep 2025 23:54:18 +0000 (+0200) Subject: [gdb/testsuite] Check spawn result in gdb.tui/tuiterm-2.exp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71725dd5d82266d9214a5d359617529bd0b826d2;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Check spawn result in gdb.tui/tuiterm-2.exp Simon reported [1] that test-case gdb.tui/tuiterm-2.exp fails with an ERROR if tclsh is missing. Fix this by checking that spawning the gdb.tcl script succeeds. While we're at it, also add some missing cleanup related to the spawned process. Tested on x86_64-linux. Approved-By: Tom Tromey [1] https://sourceware.org/pipermail/gdb-patches/2025-September/220736.html --- diff --git a/gdb/testsuite/gdb.tui/tuiterm-2.exp b/gdb/testsuite/gdb.tui/tuiterm-2.exp index a451834b640..3dfbd63c5fb 100644 --- a/gdb/testsuite/gdb.tui/tuiterm-2.exp +++ b/gdb/testsuite/gdb.tui/tuiterm-2.exp @@ -152,14 +152,17 @@ with_override Term::accept_gdb_output test_accept_gdb_output { } } -with_test_prefix "Unrecognized escape sequence" { - spawn $srcdir/$subdir/gdb.tcl - switch_gdb_spawn_id $spawn_id +proc_with_prefix unrecognized_escape_sequence {} { + if { [spawn $::srcdir/$::subdir/gdb.tcl] == 0 } { + unsupported "cannot spawn gdb.tcl" + return + } + switch_gdb_spawn_id $spawn_id Term::_setup 4 20 - save_vars timeout { - set timeout 1 + save_vars ::timeout { + set ::timeout 1 set line { 0 0 20 1 } @@ -178,4 +181,9 @@ with_test_prefix "Unrecognized escape sequence" { "echoed escape sequence" } Term::dump_screen + + close $spawn_id + clear_gdb_spawn_id } + +unrecognized_escape_sequence