[34/46] Use require isnative

Message ID 20221217000818.3729389-35-tom@tromey.com
State Committed
Headers
Series Rewrite "require" test procedure and use it more often |

Commit Message

Tom Tromey Dec. 17, 2022, 12:08 a.m. UTC
  This changes some tests to use "require isnative".
---
 gdb/testsuite/gdb.arch/s390-multiarch.exp         | 3 ++-
 gdb/testsuite/gdb.base/argv0-symlink.exp          | 5 +----
 gdb/testsuite/gdb.base/attach-pie-misread.exp     | 5 ++---
 gdb/testsuite/gdb.base/bigcore.exp                | 5 +----
 gdb/testsuite/gdb.base/break-interp.exp           | 5 ++---
 gdb/testsuite/gdb.base/corefile.exp               | 4 +---
 gdb/testsuite/gdb.base/corefile2.exp              | 4 +---
 gdb/testsuite/gdb.base/jit-reader.exp             | 6 +-----
 gdb/testsuite/gdb.base/prelink.exp                | 3 ++-
 gdb/testsuite/gdb.base/skip-solib.exp             | 4 ++--
 gdb/testsuite/gdb.mi/mi-async.exp                 | 3 ++-
 gdb/testsuite/gdb.mi/mi-corefile.exp              | 4 +---
 gdb/testsuite/gdb.threads/attach-into-signal.exp  | 4 ++--
 gdb/testsuite/gdb.threads/attach-slow-waitpid.exp | 4 ++--
 gdb/testsuite/gdb.threads/attach-stopped.exp      | 4 ++--
 gdb/testsuite/gdb.threads/corethreads.exp         | 3 ++-
 16 files changed, 26 insertions(+), 40 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.arch/s390-multiarch.exp b/gdb/testsuite/gdb.arch/s390-multiarch.exp
index 71cb53a5db9..1d98d887c1f 100644
--- a/gdb/testsuite/gdb.arch/s390-multiarch.exp
+++ b/gdb/testsuite/gdb.arch/s390-multiarch.exp
@@ -23,7 +23,8 @@ 
 # running native.  It should be executed on a sufficiently new Linux
 # kernel that provides the 'system_call' regset.
 
-if { ![isnative] || ![istarget s390x-*-* ] } {
+require isnative
+if { ![istarget s390x-*-* ] } {
     verbose "Skipping s390 multi-arch tests."
     return
 }
diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
index 0838b07c246..8247505392c 100644
--- a/gdb/testsuite/gdb.base/argv0-symlink.exp
+++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
@@ -20,10 +20,7 @@ 
 # Therefore, it can't work reliably on anything other than configurations 
 # where build/host/target are all the same.
 
-if { ![isnative] } {
-    unsupported "argv0-symlink.exp not supported on non-native target"
-    return -1
-}
+require isnative
 
 if { [is_remote host] } {
     unsupported "argv0-symlink.exp not supported on remote host"
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index 2049dd4bb88..d1614b38242 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -14,9 +14,8 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-require !use_gdb_stub
-if { ![isnative] || [is_remote host]
-     || ![istarget *-linux*] || [skip_shlib_tests]} {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index 8acb716c9b5..8f32133deb7 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -20,10 +20,7 @@ 
 # Are we on a target board?  As of 2004-02-12, GDB didn't have a
 # mechanism that would let it efficiently access a remote corefile.
 
-if {![isnative]} {
-    untested "remote system"
-    return
-}
+require isnative
 
 # Can the system run this test (in particular support sparse
 # corefiles)?  On systems that lack sparse corefile support this test
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 3ec47628256..f0923239195 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -14,9 +14,8 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This test only works on GNU/Linux.
-require !use_gdb_stub
-if { ![isnative] || [is_remote host]
-     || ![istarget *-linux*] || [skip_shlib_tests]} {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index f15e1e9e81d..283f5af6792 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -17,9 +17,7 @@ 
 
 
 # are we on a target board
-if {![isnative]} {
-    return
-}
+require isnative
 
 standard_testfile coremaker.c
 
diff --git a/gdb/testsuite/gdb.base/corefile2.exp b/gdb/testsuite/gdb.base/corefile2.exp
index b08bd714ca9..353833a3570 100644
--- a/gdb/testsuite/gdb.base/corefile2.exp
+++ b/gdb/testsuite/gdb.base/corefile2.exp
@@ -18,9 +18,7 @@ 
 # coremaker2.c for details.
 
 # are we on a target board
-if {![isnative]} {
-    return
-}
+require isnative
 
 # Some of these tests will only work on GNU/Linux due to the
 # fact that Linux core files includes a section describing
diff --git a/gdb/testsuite/gdb.base/jit-reader.exp b/gdb/testsuite/gdb.base/jit-reader.exp
index bda31fef0a6..d13c1336132 100644
--- a/gdb/testsuite/gdb.base/jit-reader.exp
+++ b/gdb/testsuite/gdb.base/jit-reader.exp
@@ -22,11 +22,7 @@  if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) || ![is_lp64_target] } {
     return -1;
 }
 
-require !skip_shlib_tests
-
-if { ![isnative] } {
-    return -1
-}
+require !skip_shlib_tests isnative
 
 # Increase this to see more detail.
 set test_verbose 0
diff --git a/gdb/testsuite/gdb.base/prelink.exp b/gdb/testsuite/gdb.base/prelink.exp
index 8145a5b8a68..755f687607b 100644
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -19,7 +19,8 @@ 
 # This file was written by Alexandre Oliva <aoliva@redhat.com>
 
 
-if { ![isnative] || [is_remote host] || [skip_shlib_tests]} {
+require isnative
+if { [is_remote host] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/skip-solib.exp b/gdb/testsuite/gdb.base/skip-solib.exp
index 49539bb6695..e1245e7b4b8 100644
--- a/gdb/testsuite/gdb.base/skip-solib.exp
+++ b/gdb/testsuite/gdb.base/skip-solib.exp
@@ -20,8 +20,8 @@ 
 #
 
 # This only works on GNU/Linux.
-if { ![isnative] || [is_remote host] || ![istarget *-linux*]
-     || [skip_shlib_tests]} {
+require isnative
+if { [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-async.exp b/gdb/testsuite/gdb.mi/mi-async.exp
index 5687c9ac335..da95225b209 100644
--- a/gdb/testsuite/gdb.mi/mi-async.exp
+++ b/gdb/testsuite/gdb.mi/mi-async.exp
@@ -21,7 +21,8 @@ 
 # mi_run_cmd, it ignores whatever target the rest of GDB testsuite is
 # using, and always tries to run natively.  So, don't do anything unless
 # we're actually testing native.
-if {!([isnative] && [istarget *-linux*])} {
+require isnative
+if {![istarget *-linux*]} {
   return
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-corefile.exp b/gdb/testsuite/gdb.mi/mi-corefile.exp
index 61aec326bcb..b3439234240 100644
--- a/gdb/testsuite/gdb.mi/mi-corefile.exp
+++ b/gdb/testsuite/gdb.mi/mi-corefile.exp
@@ -18,9 +18,7 @@ 
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
-if {![isnative]} {
-    return
-}
+require isnative
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp
index c2b8ffebf65..75ddc680806 100644
--- a/gdb/testsuite/gdb.threads/attach-into-signal.exp
+++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp
@@ -17,8 +17,8 @@ 
 # This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-require !use_gdb_stub
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
index aa9488af8a6..b11692ad601 100644
--- a/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
+++ b/gdb/testsuite/gdb.threads/attach-slow-waitpid.exp
@@ -37,8 +37,8 @@ 
 # during the attach phase.
 
 # This test only works on Linux
-require !use_gdb_stub
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
index 320c304bb7a..ecdb234584e 100644
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
@@ -18,8 +18,8 @@ 
 # This file was updated by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
 # This test only works on Linux
-require !use_gdb_stub
-if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
+require !use_gdb_stub isnative
+if { [is_remote host] || ![istarget *-linux*] } {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/corethreads.exp b/gdb/testsuite/gdb.threads/corethreads.exp
index 7e10f557776..0108c7469c7 100644
--- a/gdb/testsuite/gdb.threads/corethreads.exp
+++ b/gdb/testsuite/gdb.threads/corethreads.exp
@@ -15,7 +15,8 @@ 
 
 # Are we on a target board?  And non-Linux targets seem to identify the thread
 # differently.
-if {![isnative] || ![istarget "*-*-linux*"]} {
+require isnative
+if {![istarget "*-*-linux*"]} {
     return
 }