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.
# 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"
}