aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-08 12:42:29 -0700
committerTom Tromey <tom@tromey.com>2023-01-13 13:18:58 -0700
commitb5075fb68d4b7a9ed1505150a395755260953809 (patch)
tree4d32d08c139c7145be62180506506a056c0756d7
parente71b6502bffecbbdd99a791c6ee7545603bafbc1 (diff)
downloadgdb-b5075fb68d4b7a9ed1505150a395755260953809.zip
gdb-b5075fb68d4b7a9ed1505150a395755260953809.tar.gz
gdb-b5075fb68d4b7a9ed1505150a395755260953809.tar.bz2
Rename to allow_tui_tests
This changes skip_tui_tests to invert the sense, and renames it to allow_tui_tests. It also rewrites this function to use the output of "gdb --configuration", and it adds a note about the state of the TUI to that output.
-rw-r--r--gdb/testsuite/gdb.base/options.exp2
-rw-r--r--gdb/testsuite/gdb.python/tui-window-disabled.exp4
-rw-r--r--gdb/testsuite/gdb.python/tui-window-names.exp6
-rw-r--r--gdb/testsuite/gdb.python/tui-window.exp5
-rw-r--r--gdb/testsuite/gdb.tui/completion.exp4
-rw-r--r--gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp2
-rw-r--r--gdb/testsuite/gdb.tui/tui-layout.exp6
-rw-r--r--gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp6
-rw-r--r--gdb/testsuite/lib/completion-support.exp2
-rw-r--r--gdb/testsuite/lib/gdb.exp17
-rw-r--r--gdb/testsuite/lib/tuiterm.exp2
-rw-r--r--gdb/top.c10
12 files changed, 28 insertions, 38 deletions
diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp
index 2be7f87..486192e 100644
--- a/gdb/testsuite/gdb.base/options.exp
+++ b/gdb/testsuite/gdb.base/options.exp
@@ -47,7 +47,7 @@ if { ![readline_is_used] } {
return -1
}
-set tui_supported_p [expr ![skip_tui_tests]]
+set tui_supported_p [allow_tui_tests]
# Check the completion result, as returned by the "maintenance show
# test-options-completion-result" command. TEST is used as test name.
diff --git a/gdb/testsuite/gdb.python/tui-window-disabled.exp b/gdb/testsuite/gdb.python/tui-window-disabled.exp
index 36ecb0b..57d41cd 100644
--- a/gdb/testsuite/gdb.python/tui-window-disabled.exp
+++ b/gdb/testsuite/gdb.python/tui-window-disabled.exp
@@ -22,6 +22,7 @@
# though the tui should be disabled.
load_lib gdb-python.exp
+require allow_tui_tests
tuiterm_env
standard_testfile
@@ -31,9 +32,6 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
}
clean_restart
-if {[skip_tui_tests]} {
- return
-}
# Copy the Python script to where the tests are being run.
set remote_python_file [gdb_remote_download host \
diff --git a/gdb/testsuite/gdb.python/tui-window-names.exp b/gdb/testsuite/gdb.python/tui-window-names.exp
index 125a5f5..1a25be8 100644
--- a/gdb/testsuite/gdb.python/tui-window-names.exp
+++ b/gdb/testsuite/gdb.python/tui-window-names.exp
@@ -18,16 +18,12 @@
load_lib gdb-python.exp
-require allow_python_tests
+require allow_python_tests allow_tui_tests
tuiterm_env
clean_restart
-if {[skip_tui_tests]} {
- return
-}
-
# Define a function we can use as a window constructor. If this ever
# gets called we'll throw an error, but that's OK, this test doesn't
# actually try to create any windows.
diff --git a/gdb/testsuite/gdb.python/tui-window.exp b/gdb/testsuite/gdb.python/tui-window.exp
index 529ed16..af2a866 100644
--- a/gdb/testsuite/gdb.python/tui-window.exp
+++ b/gdb/testsuite/gdb.python/tui-window.exp
@@ -16,7 +16,7 @@
# Test a TUI window implemented in Python.
load_lib gdb-python.exp
-require allow_python_tests
+require allow_python_tests allow_tui_tests
tuiterm_env
# This test doesn't care about the inferior.
@@ -27,9 +27,6 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
}
clean_restart
-if {[skip_tui_tests]} {
- return
-}
Term::clean_restart 24 80 $testfile
diff --git a/gdb/testsuite/gdb.tui/completion.exp b/gdb/testsuite/gdb.tui/completion.exp
index 0095648..a3b3114 100644
--- a/gdb/testsuite/gdb.tui/completion.exp
+++ b/gdb/testsuite/gdb.tui/completion.exp
@@ -13,10 +13,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+require allow_tui_tests
+
gdb_exit
gdb_start
-if {[skip_tui_tests] || [target_info exists gdb,nointerrupts]} {
+if {[target_info exists gdb,nointerrupts]} {
return
}
diff --git a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp
index 0ad9130..7e3cff3 100644
--- a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp
+++ b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp
@@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" \
clean_restart "$binfile"
-if {[skip_tui_tests]} {
+if {![allow_tui_tests]} {
# TUI support is disabled. Check for error message.
gdb_test "layout asm" "Undefined command: \"layout\". Try \"help\"."
return
diff --git a/gdb/testsuite/gdb.tui/tui-layout.exp b/gdb/testsuite/gdb.tui/tui-layout.exp
index 97734cf..2c50219 100644
--- a/gdb/testsuite/gdb.tui/tui-layout.exp
+++ b/gdb/testsuite/gdb.tui/tui-layout.exp
@@ -16,16 +16,14 @@
# Minimal testcase that just checks that the various "layout $foo"
# commands do not cause gdb to crash.
+require allow_tui_tests
+
standard_testfile
if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
return -1
}
-if {[skip_tui_tests]} {
- return
-}
-
# Test one layout command. EXECUTION indicates whether to activate
# the layout with or without execution.
diff --git a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp
index 5a2a420..b7ea67c 100644
--- a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp
+++ b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp
@@ -30,13 +30,11 @@
#
# (gdb)
+require allow_tui_tests
+
gdb_exit
gdb_start
-if {[skip_tui_tests]} {
- return
-}
-
# Enable the TUI.
set test "tui enable"
diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp
index f47f1d3..bf9c5ad 100644
--- a/gdb/testsuite/lib/completion-support.exp
+++ b/gdb/testsuite/lib/completion-support.exp
@@ -555,7 +555,7 @@ proc test_gdb_completion_offers_commands {input_line} {
# TUI adds additional commands to the possible completions, so we
# need different patterns depending on whether or not it is enabled.
- if { [skip_tui_tests] } {
+ if { ![allow_tui_tests] } {
test_gdb_complete_multiple $input_line "" "" {
"!"
"actions"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 31f11b2..5359315 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2572,20 +2572,11 @@ gdb_caching_proc allow_dlmopen_tests {
return $allow_dlmopen_tests
}
-# Return 1 if we should skip tui related tests.
+# Return 1 if we should allow TUI-related tests.
-proc skip_tui_tests {} {
- global gdb_prompt
-
- gdb_test_multiple "help layout" "verify tui support" {
- -re "Undefined command: \"layout\".*$gdb_prompt $" {
- return 1
- }
- -re "$gdb_prompt $" {
- }
- }
-
- return 0
+gdb_caching_proc allow_tui_tests {
+ set output [remote_exec host $::GDB --configuration]
+ return [expr {[string first "--enable-tui" $output] != -1}]
}
# Test files shall make sure all the test result lines in gdb.sum are
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index 591c4ca..c38ccbb 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -778,7 +778,7 @@ namespace eval Term {
# Setup ready for starting the tui, but don't actually start it.
# Returns 1 on success, 0 if TUI tests should be skipped.
proc prepare_for_tui {} {
- if {[skip_tui_tests]} {
+ if {![allow_tui_tests]} {
return 0
}
diff --git a/gdb/top.c b/gdb/top.c
index c32ab89..205eb36 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1649,6 +1649,16 @@ This GDB was configured as follows:\n\
"));
#endif
+#ifdef TUI
+ gdb_printf (stream, _("\
+ --enable-tui\n\
+"));
+#else
+ gdb_printf (stream, _("\
+ --disable-tui\n\
+"));
+#endif
+
#ifdef RELOC_SRCDIR
gdb_printf (stream, _("\
--with-relocated-sources=%s\n\