summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-22 13:38:26 -0700
committerTom Tromey <tom@tromey.com>2023-01-25 09:02:11 -0700
commit52c0551e9ac03a54e282f9e17d3291c1c8848a7b (patch)
tree91c2286a7bbd6c070ff6a0084f45d3782bb3119a /gdb/testsuite/gdb.base
parente0a8643d2cea10858f30a8378f6cab4472dee0f9 (diff)
downloadbinutils-gdb-52c0551e9ac03a54e282f9e17d3291c1c8848a7b.tar.gz
Use require with is_remote
This changes some tests to use require with 'is_remote', rather than an explicit test. This adds uniformity helps clean up more spots where a test might exit early without any notification.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/annotate-symlink.exp7
-rw-r--r--gdb/testsuite/gdb.base/argv0-symlink.exp5
-rw-r--r--gdb/testsuite/gdb.base/attach-pie-misread.exp5
-rw-r--r--gdb/testsuite/gdb.base/auto-load.exp4
-rw-r--r--gdb/testsuite/gdb.base/break-interp.exp5
-rw-r--r--gdb/testsuite/gdb.base/bt-on-fatal-signal.exp5
-rw-r--r--gdb/testsuite/gdb.base/fullname.exp9
-rw-r--r--gdb/testsuite/gdb.base/fullpath-expand.exp7
-rw-r--r--gdb/testsuite/gdb.base/gdbhistsize-history.exp6
-rw-r--r--gdb/testsuite/gdb.base/gdbinit-history.exp9
-rw-r--r--gdb/testsuite/gdb.base/info-fun.exp4
-rw-r--r--gdb/testsuite/gdb.base/libsegfault.exp5
-rw-r--r--gdb/testsuite/gdb.base/macro-source-path.exp4
-rw-r--r--gdb/testsuite/gdb.base/prelink.exp4
-rw-r--r--gdb/testsuite/gdb.base/realname-expand.exp7
-rw-r--r--gdb/testsuite/gdb.base/skip-solib.exp5
-rw-r--r--gdb/testsuite/gdb.base/solib-corrupted.exp8
-rw-r--r--gdb/testsuite/gdb.base/solib-nodir.exp4
-rw-r--r--gdb/testsuite/gdb.base/solib-search.exp5
-rw-r--r--gdb/testsuite/gdb.base/startup-with-shell.exp5
-rw-r--r--gdb/testsuite/gdb.base/style-logging.exp5
-rw-r--r--gdb/testsuite/gdb.base/valgrind-bt.exp5
-rw-r--r--gdb/testsuite/gdb.base/valgrind-disp-step.exp5
-rw-r--r--gdb/testsuite/gdb.base/valgrind-infcall-2.exp5
-rw-r--r--gdb/testsuite/gdb.base/valgrind-infcall.exp5
-rw-r--r--gdb/testsuite/gdb.base/warning.exp5
26 files changed, 41 insertions, 102 deletions
diff --git a/gdb/testsuite/gdb.base/annotate-symlink.exp b/gdb/testsuite/gdb.base/annotate-symlink.exp
index a0f8ed9eabc..73412406792 100644
--- a/gdb/testsuite/gdb.base/annotate-symlink.exp
+++ b/gdb/testsuite/gdb.base/annotate-symlink.exp
@@ -15,10 +15,9 @@
standard_testfile realname-expand.c realname-expand-real.c
-if [is_remote host] {
- unsupported "compiling on a remote host does not support a filename with directory."
- return 0
-}
+# Compiling on a remote host does not support a filename with
+# directory.
+require {!is_remote host}
set srcdirabs [file join [pwd] $srcdir]
set srcfilelink [standard_output_file realname-expand-link.c]
diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
index b321a244221..57b348b36bb 100644
--- a/gdb/testsuite/gdb.base/argv0-symlink.exp
+++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
@@ -22,10 +22,7 @@
require isnative
-if { [is_remote host] } {
- unsupported "argv0-symlink.exp not supported on remote host"
- return -1
-}
+require {!is_remote host}
standard_testfile
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index 96f02429abd..484bd487a3b 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -15,9 +15,8 @@
# This test only works on GNU/Linux.
require !use_gdb_stub isnative allow_shlib_tests
-if { [is_remote host] || ![istarget *-linux*] } {
- return
-}
+require {!is_remote host}
+require {istarget *-linux*}
load_lib prelink-support.exp
diff --git a/gdb/testsuite/gdb.base/auto-load.exp b/gdb/testsuite/gdb.base/auto-load.exp
index 23cf72a942f..02ce0467730 100644
--- a/gdb/testsuite/gdb.base/auto-load.exp
+++ b/gdb/testsuite/gdb.base/auto-load.exp
@@ -15,9 +15,7 @@
standard_testfile
-if [is_remote host] {
- return 0
-}
+require {!is_remote host}
set targetdir "${binfile}.dir"
set sourcescript "${srcdir}/${subdir}/${testfile}-script"
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 9652b32b632..6061c739d05 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -15,9 +15,8 @@
# This test only works on GNU/Linux.
require !use_gdb_stub isnative allow_shlib_tests
-if { [is_remote host] || ![istarget *-linux*] } {
- return
-}
+require {!is_remote host}
+require {istarget *-linux*}
load_lib prelink-support.exp
diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
index 128db758284..d0364cc6b89 100644
--- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
+++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
@@ -23,10 +23,7 @@ standard_testfile
# remote host (will the signal go to GDB, or the program that
# established the connection to the remote host?), so just skip this
# test for remote host setups.
-if {[is_remote host]} {
- untested $testfile
- return -1
-}
+require {!is_remote host}
if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
return -1
diff --git a/gdb/testsuite/gdb.base/fullname.exp b/gdb/testsuite/gdb.base/fullname.exp
index 19da89eae45..51ccb012688 100644
--- a/gdb/testsuite/gdb.base/fullname.exp
+++ b/gdb/testsuite/gdb.base/fullname.exp
@@ -18,12 +18,9 @@
standard_testfile
-# We rely on being able to copy things around.
-
-if { [is_remote host] } {
- untested "setting breakpoints by full path"
- return -1
-}
+# We rely on being able to copy things around and being able to set
+# breakpoints by full path.
+require {!is_remote host}
# Create a temporary file in the build directory. Use a different
# filename in case ${srcdir} == ${objdir}.
diff --git a/gdb/testsuite/gdb.base/fullpath-expand.exp b/gdb/testsuite/gdb.base/fullpath-expand.exp
index aee23fe0fea..285d0be08ec 100644
--- a/gdb/testsuite/gdb.base/fullpath-expand.exp
+++ b/gdb/testsuite/gdb.base/fullpath-expand.exp
@@ -15,10 +15,9 @@
standard_testfile .c fullpath-expand-func.c
-if [is_remote host] {
- unsupported "compiling on a remote host does not support a filename with directory."
- return 0
-}
+# Compiling on a remote host does not support a filename with
+# directory.
+require {!is_remote host}
if { [file pathtype $objdir] != "absolute" } {
untested "objdir $objdir is not absolute"
diff --git a/gdb/testsuite/gdb.base/gdbhistsize-history.exp b/gdb/testsuite/gdb.base/gdbhistsize-history.exp
index d3e4a052c6b..59fd2d0c143 100644
--- a/gdb/testsuite/gdb.base/gdbhistsize-history.exp
+++ b/gdb/testsuite/gdb.base/gdbhistsize-history.exp
@@ -20,11 +20,7 @@
# We cannot expect remote hosts to see environment variables set on the
# local machine.
-
-if { [is_remote host] } {
- unsupported "can't set environment variables on remote host"
- return -1
-}
+require {!is_remote host}
# Check that the history size is properly set to SIZE when the environment
# variable ENV_VAR is set to GDBHISTSIZE.
diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp
index 46d76b0e239..4c73293627c 100644
--- a/gdb/testsuite/gdb.base/gdbinit-history.exp
+++ b/gdb/testsuite/gdb.base/gdbinit-history.exp
@@ -18,16 +18,13 @@
# Test the setting of "history size" via $HOME/.gdbinit
# This test depends on being able to set $HOME and $GDBHISTSIZE.
-# We cannot expect remote hosts to see environment variables set on the
-# local machine.
# Do not run if gdb debug is enabled - it interferes with the command history.
require !gdb_debug_enabled
-if { [is_remote host] } {
- unsupported "can't set environment variables on remote host"
- return -1
-}
+# We cannot expect remote hosts to see environment variables set on the
+# local machine.
+require {!is_remote host}
# Check that the history size is properly set to SIZE when reading the .gdbinit
# file located in HOME with the environment variable GDBHISTSIZE optionally
diff --git a/gdb/testsuite/gdb.base/info-fun.exp b/gdb/testsuite/gdb.base/info-fun.exp
index 683c732e671..c14d87b8cc7 100644
--- a/gdb/testsuite/gdb.base/info-fun.exp
+++ b/gdb/testsuite/gdb.base/info-fun.exp
@@ -13,9 +13,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require allow_shlib_tests
-if { [is_remote target] } {
- return 0
-}
+require {!is_remote target}
# Library file.
set libname "info-fun-solib"
diff --git a/gdb/testsuite/gdb.base/libsegfault.exp b/gdb/testsuite/gdb.base/libsegfault.exp
index 9a983992ea0..7862c9600fe 100644
--- a/gdb/testsuite/gdb.base/libsegfault.exp
+++ b/gdb/testsuite/gdb.base/libsegfault.exp
@@ -22,10 +22,7 @@
# We cannot expect remote hosts to see environment variables set on
# the local machine.
-if { [is_remote host] } {
- unsupported "can't set environment variables on remote host"
- return -1
-}
+require {!is_remote host}
# Spawn GDB with LIB preloaded with LD_PRELOAD. CMDLINE_OPTS are
# command line options passed to GDB.
diff --git a/gdb/testsuite/gdb.base/macro-source-path.exp b/gdb/testsuite/gdb.base/macro-source-path.exp
index d46e93bb5c1..2d6eaeb6c65 100644
--- a/gdb/testsuite/gdb.base/macro-source-path.exp
+++ b/gdb/testsuite/gdb.base/macro-source-path.exp
@@ -23,9 +23,7 @@ standard_testfile
# If the host is remote, source files are uploaded to the host and compiled
# there, but without the directory structure we expect, making the test
# pointless. Skip the test in that case.
-if { [is_remote host] } {
- return
-}
+require {!is_remote host}
# Copy the source file at these locations in the output directory ($out):
#
diff --git a/gdb/testsuite/gdb.base/prelink.exp b/gdb/testsuite/gdb.base/prelink.exp
index 6945a923194..12837b95255 100644
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -20,9 +20,7 @@
require isnative allow_shlib_tests is_c_compiler_gcc
-if { [is_remote host] } {
- return
-}
+require {!is_remote host}
load_lib prelink-support.exp
diff --git a/gdb/testsuite/gdb.base/realname-expand.exp b/gdb/testsuite/gdb.base/realname-expand.exp
index ade6fe22c52..74dc725a4d0 100644
--- a/gdb/testsuite/gdb.base/realname-expand.exp
+++ b/gdb/testsuite/gdb.base/realname-expand.exp
@@ -15,10 +15,9 @@
standard_testfile .c realname-expand-real.c
-if [is_remote host] {
- unsupported "compiling on a remote host does not support a filename with directory."
- return 0
-}
+# Compiling on a remote host does not support a filename with
+# directory.
+require {!is_remote host}
set srcdirabs [file join [pwd] $srcdir]
set srcfilelink [standard_output_file realname-expand-link.c]
diff --git a/gdb/testsuite/gdb.base/skip-solib.exp b/gdb/testsuite/gdb.base/skip-solib.exp
index e04bec9c504..3cdb455bb59 100644
--- a/gdb/testsuite/gdb.base/skip-solib.exp
+++ b/gdb/testsuite/gdb.base/skip-solib.exp
@@ -21,9 +21,8 @@
# This only works on GNU/Linux.
require isnative allow_shlib_tests
-if { [is_remote host] || ![istarget *-linux*] } {
- return
-}
+require {!is_remote host}
+require {istarget *-linux*}
set test "skip-solib"
set srcfile_main "${test}-main.c"
diff --git a/gdb/testsuite/gdb.base/solib-corrupted.exp b/gdb/testsuite/gdb.base/solib-corrupted.exp
index 644c8ece11f..e778711a9d6 100644
--- a/gdb/testsuite/gdb.base/solib-corrupted.exp
+++ b/gdb/testsuite/gdb.base/solib-corrupted.exp
@@ -15,11 +15,9 @@
require allow_shlib_tests
-if {[is_remote target]} {
- # gdbserver prints the warning message but expect is parsing only the GDB
- # output, not the gdbserver output.
- return 0
-}
+# gdbserver prints the warning message but expect is parsing only the GDB
+# output, not the gdbserver output.
+require {!is_remote target}
set testfile "solib-corrupted"
set srcfile start.c
diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp
index dd0724909ad..1530d80d694 100644
--- a/gdb/testsuite/gdb.base/solib-nodir.exp
+++ b/gdb/testsuite/gdb.base/solib-nodir.exp
@@ -16,9 +16,7 @@
require allow_shlib_tests
# The testcase assumes the target can access the OBJDIR.
-if [is_remote target] {
- return
-}
+require {!is_remote target}
# We need to be able to influence the target's environment and working
# directory. Can't do that if when we connect the inferior is already
diff --git a/gdb/testsuite/gdb.base/solib-search.exp b/gdb/testsuite/gdb.base/solib-search.exp
index 5e9e3d43ee0..1d678efc2d5 100644
--- a/gdb/testsuite/gdb.base/solib-search.exp
+++ b/gdb/testsuite/gdb.base/solib-search.exp
@@ -17,10 +17,7 @@
# is properly reset when the path is changed.
require allow_shlib_tests
-if {[is_remote target]} {
- untested "skipping remote target and shared library tests"
- return -1
-}
+require {!is_remote target}
# Build "wrong" and "right" versions of the libraries in separate directories.
set wrong_lib_subdir "solib-search-wrong"
diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp
index b1f868b520a..51b1e4fa922 100644
--- a/gdb/testsuite/gdb.base/startup-with-shell.exp
+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp
@@ -20,10 +20,7 @@ require !use_gdb_stub
# There's no easy way to set environment variables on remote targets
# (via dejagnu) yet.
-if { [is_remote target] } {
- untested "remote board"
- return
-}
+require {!is_remote target}
standard_testfile
diff --git a/gdb/testsuite/gdb.base/style-logging.exp b/gdb/testsuite/gdb.base/style-logging.exp
index dcf13575a17..a156c39146f 100644
--- a/gdb/testsuite/gdb.base/style-logging.exp
+++ b/gdb/testsuite/gdb.base/style-logging.exp
@@ -18,10 +18,7 @@
# Do not run if gdb debug is enabled as it will interfere with log redirect.
require !gdb_debug_enabled
-if {[is_remote host]} {
- untested "does not work on remote host"
- return 0
-}
+require {!is_remote host}
standard_testfile style.c
diff --git a/gdb/testsuite/gdb.base/valgrind-bt.exp b/gdb/testsuite/gdb.base/valgrind-bt.exp
index da0261eabe6..6849a344ee3 100644
--- a/gdb/testsuite/gdb.base/valgrind-bt.exp
+++ b/gdb/testsuite/gdb.base/valgrind-bt.exp
@@ -18,10 +18,7 @@ require allow_xml_test
load_lib valgrind.exp
-if [is_remote target] {
- # The test always runs locally.
- return 0
-}
+require {!is_remote target}
standard_testfile .c
if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
diff --git a/gdb/testsuite/gdb.base/valgrind-disp-step.exp b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
index 3fb4341d2c7..1033ac8c6a7 100644
--- a/gdb/testsuite/gdb.base/valgrind-disp-step.exp
+++ b/gdb/testsuite/gdb.base/valgrind-disp-step.exp
@@ -23,10 +23,7 @@ require allow_xml_test
load_lib valgrind.exp
-if [is_remote target] {
- # The test always runs locally.
- return 0
-}
+require {!is_remote target}
standard_testfile .c
if {[build_executable "failed to build" $testfile $srcfile {debug}] == -1} {
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
index 6ed6ecd1d42..aa8f472cdb5 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall-2.exp
@@ -34,10 +34,7 @@ require allow_xml_test
load_lib valgrind.exp
-if [is_remote target] {
- # The test always runs locally.
- return 0
-}
+require {!is_remote target}
standard_testfile .c
if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp
index bcaca02c900..01267734409 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp
@@ -18,10 +18,7 @@ require allow_xml_test
load_lib valgrind.exp
-if [is_remote target] {
- # The test always runs locally.
- return 0
-}
+require {!is_remote target}
standard_testfile .c
if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
diff --git a/gdb/testsuite/gdb.base/warning.exp b/gdb/testsuite/gdb.base/warning.exp
index 50e680b920d..e58bde537f1 100644
--- a/gdb/testsuite/gdb.base/warning.exp
+++ b/gdb/testsuite/gdb.base/warning.exp
@@ -15,10 +15,7 @@
# Test that an early warning does not cause a crash.
-if {[is_remote host]} {
- unsupported "warning.exp can only run on local host"
- return
-}
+require {!is_remote host}
set tname [standard_temp_file warning]
set fd [open $tname w]