aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.gdb')
-rw-r--r--gdb/testsuite/gdb.gdb/unittest.exp21
1 files changed, 17 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.gdb/unittest.exp b/gdb/testsuite/gdb.gdb/unittest.exp
index 0ddd206..bcb4bbd 100644
--- a/gdb/testsuite/gdb.gdb/unittest.exp
+++ b/gdb/testsuite/gdb.gdb/unittest.exp
@@ -40,6 +40,7 @@ proc run_selftests { binfile } {
clean_restart ${binfile}
}
+ set enabled 1
set test "maintenance selftest"
gdb_test_multiple $test $test {
-re ".*Running selftest \[^\n\r\]+\." {
@@ -57,23 +58,35 @@ proc run_selftests { binfile } {
}
-re "Selftests have been disabled for this build.\r\n$gdb_prompt $" {
unsupported $test
+ set enabled 0
}
}
+
+ return $enabled
}
# Test completion of command "maintenance selftest".
proc_with_prefix test_completion {} {
+ global self_tests_enabled
+
clean_restart
- test_gdb_complete_tab_multiple "maintenance selftest string_v" "" \
- {string_vappendf string_view string_vprintf}
- test_gdb_complete_tab_unique "maintenance selftest string_vie" "maintenance selftest string_view" " "
+
+ if { $self_tests_enabled } {
+ test_gdb_complete_tab_multiple "maintenance selftest string_v" "" \
+ {string_vappendf string_view string_vprintf}
+ test_gdb_complete_tab_unique "maintenance selftest string_vie" \
+ "maintenance selftest string_view" " "
+ } else {
+ test_gdb_complete_tab_none "maintenance selftest string_v"
+ test_gdb_complete_tab_none "maintenance selftest string_vie"
+ }
test_gdb_complete_tab_unique "maintenance selftest -ver" "maintenance selftest -verbose" " "
test_gdb_complete_tab_none "maintenance selftest name_that_does_not_exist"
}
with_test_prefix "no executable loaded" {
- run_selftests ""
+ set self_tests_enabled [run_selftests ""]
}
with_test_prefix "executable loaded" {