From: Tom de Vries Date: Tue, 3 Dec 2024 15:53:14 +0000 (+0100) Subject: [gdb/testsuite] Fix gdb.python/python.exp with --disable-tui X-Git-Tag: gdb-16-branchpoint~207 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6804a0969d4a27870e76e472d0e5b66a7c4c9dc9;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix gdb.python/python.exp with --disable-tui When building gdb with --disable-tui, we run into: ... (gdb) python print(type(gdb.TuiWindow))^M Python Exception : \ module 'gdb' has no attribute 'TuiWindow'^M Error occurred in Python: module 'gdb' has no attribute 'TuiWindow'^M (gdb) FAIL: gdb.python/python.exp: gdb.TuiWindow is registered ... Fix this by skipping the test for --disable-tui. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index e8eb9ec727b..19c8958b30c 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -567,6 +567,10 @@ if { [use_gdb_stub] == 0 } { # directly. foreach type {Instruction LazyString Membuf Record RecordFunctionSegment \ RecordGap RecordInstruction TuiWindow} { + if { $type == "TuiWindow" && ![allow_tui_tests] } { + continue + } + gdb_test "python print(type(gdb.$type))" "" \ "gdb.$type is registered" }