]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.python/python.exp with --disable-tui
authorTom de Vries <tdevries@suse.de>
Tue, 3 Dec 2024 15:53:14 +0000 (16:53 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 3 Dec 2024 15:53:14 +0000 (16:53 +0100)
When building gdb with --disable-tui, we run into:
...
(gdb) python print(type(gdb.TuiWindow))^M
Python Exception <class 'AttributeError'>: \
  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.

gdb/testsuite/gdb.python/python.exp

index e8eb9ec727bf65c262a52dc74564a5e4439adfe8..19c8958b30cddc9b3372851b8b07c89f2c8d81d7 100644 (file)
@@ -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))" "<class 'type'>" \
        "gdb.$type is registered"
 }