[22/46] Use require skip_btrace_tests

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

Commit Message

Tom Tromey Dec. 17, 2022, 12:07 a.m. UTC
  This changes some tests to use "require skip_btrace_tests".
---
 gdb/testsuite/gdb.btrace/buffer-size.exp              | 5 +----
 gdb/testsuite/gdb.btrace/data.exp                     | 5 +----
 gdb/testsuite/gdb.btrace/delta.exp                    | 5 +----
 gdb/testsuite/gdb.btrace/enable-new-thread.exp        | 5 +----
 gdb/testsuite/gdb.btrace/enable-running.exp           | 5 +----
 gdb/testsuite/gdb.btrace/enable.exp                   | 5 +----
 gdb/testsuite/gdb.btrace/exception.exp                | 5 +----
 gdb/testsuite/gdb.btrace/function_call_history.exp    | 5 +----
 gdb/testsuite/gdb.btrace/gcore.exp                    | 5 +----
 gdb/testsuite/gdb.btrace/instruction_history.exp      | 5 +----
 gdb/testsuite/gdb.btrace/multi-inferior.exp           | 5 +----
 gdb/testsuite/gdb.btrace/multi-thread-step.exp        | 5 +----
 gdb/testsuite/gdb.btrace/nohist.exp                   | 5 +----
 gdb/testsuite/gdb.btrace/non-stop.exp                 | 5 +----
 gdb/testsuite/gdb.btrace/reconnect.exp                | 5 +----
 gdb/testsuite/gdb.btrace/record_goto-step.exp         | 5 +----
 gdb/testsuite/gdb.btrace/record_goto.exp              | 5 +----
 gdb/testsuite/gdb.btrace/rn-dl-bind.exp               | 5 +----
 gdb/testsuite/gdb.btrace/segv.exp                     | 5 +----
 gdb/testsuite/gdb.btrace/step.exp                     | 5 +----
 gdb/testsuite/gdb.btrace/stepi.exp                    | 5 +----
 gdb/testsuite/gdb.btrace/tailcall-only.exp            | 5 +----
 gdb/testsuite/gdb.btrace/tailcall.exp                 | 5 +----
 gdb/testsuite/gdb.btrace/unknown_functions.exp        | 5 +----
 gdb/testsuite/gdb.btrace/vdso.exp                     | 5 +----
 gdb/testsuite/gdb.python/py-record-btrace-threads.exp | 5 +----
 gdb/testsuite/gdb.python/py-record-btrace.exp         | 5 +----
 27 files changed, 27 insertions(+), 108 deletions(-)
  

Comments

Terekhov, Mikhail via Gdb-patches Dec. 17, 2022, 9:22 a.m. UTC | #1
>This changes some tests to use "require skip_btrace_tests".
>---
> gdb/testsuite/gdb.btrace/buffer-size.exp              | 5 +----
> gdb/testsuite/gdb.btrace/data.exp                     | 5 +----
> gdb/testsuite/gdb.btrace/delta.exp                    | 5 +----
> gdb/testsuite/gdb.btrace/enable-new-thread.exp        | 5 +----
> gdb/testsuite/gdb.btrace/enable-running.exp           | 5 +----
> gdb/testsuite/gdb.btrace/enable.exp                   | 5 +----
> gdb/testsuite/gdb.btrace/exception.exp                | 5 +----
> gdb/testsuite/gdb.btrace/function_call_history.exp    | 5 +----
> gdb/testsuite/gdb.btrace/gcore.exp                    | 5 +----
> gdb/testsuite/gdb.btrace/instruction_history.exp      | 5 +----
> gdb/testsuite/gdb.btrace/multi-inferior.exp           | 5 +----
> gdb/testsuite/gdb.btrace/multi-thread-step.exp        | 5 +----
> gdb/testsuite/gdb.btrace/nohist.exp                   | 5 +----
> gdb/testsuite/gdb.btrace/non-stop.exp                 | 5 +----
> gdb/testsuite/gdb.btrace/reconnect.exp                | 5 +----
> gdb/testsuite/gdb.btrace/record_goto-step.exp         | 5 +----
> gdb/testsuite/gdb.btrace/record_goto.exp              | 5 +----
> gdb/testsuite/gdb.btrace/rn-dl-bind.exp               | 5 +----
> gdb/testsuite/gdb.btrace/segv.exp                     | 5 +----
> gdb/testsuite/gdb.btrace/step.exp                     | 5 +----
> gdb/testsuite/gdb.btrace/stepi.exp                    | 5 +----
> gdb/testsuite/gdb.btrace/tailcall-only.exp            | 5 +----
> gdb/testsuite/gdb.btrace/tailcall.exp                 | 5 +----
> gdb/testsuite/gdb.btrace/unknown_functions.exp        | 5 +----
> gdb/testsuite/gdb.btrace/vdso.exp                     | 5 +----
> gdb/testsuite/gdb.python/py-record-btrace-threads.exp | 5 +----
> gdb/testsuite/gdb.python/py-record-btrace.exp         | 5 +----
> 27 files changed, 27 insertions(+), 108 deletions(-)

LGTM with two nits and a general comment below.


>-if { [skip_btrace_tests] } {
>-    unsupported "target does not support record-btrace"
>-    return -1
>-}
>+require !skip_btrace_tests

This looks a little bit odd, now, and the ! is easy to miss.  Those skip checks
should probably be rewritten as support checks to fit better into the new
require logic.

>-if { [skip_btrace_tests] } {
>-    unsupported "target does not support record-btrace"
>-    return -1
>-}
>+require !skip_btrace_tests
>
> if { [use_gdb_stub] } {
>     unsupported "test creates multiple inferiors"

Should this be

require !skip_btrace_tests !use_gdb_stub

>-if { [skip_btrace_tests] } {
>-    unsupported "target does not support record-btrace"
>-    return -1
>-}
>+require !skip_btrace_tests
> if { [skip_gdbserver_tests] } {
>     unsupported "target does not support gdbserver"
>     return -1

Same here with skip_gdbserver_tests.

regards,
markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
  
Tom Tromey Dec. 18, 2022, 5:46 p.m. UTC | #2
>> +require !skip_btrace_tests

> This looks a little bit odd, now, and the ! is easy to miss.  Those skip checks
> should probably be rewritten as support checks to fit better into the new
> require logic.

Yes, I think this would be an improvement as well; and if this series
goes in, I think we should encourage future predicates to be written in
the "positive" sense.

> Should this be
> require !skip_btrace_tests !use_gdb_stub
...
> Same here with skip_gdbserver_tests.

These changes are made later in the series, though I didn't make much
effort to consistently combine calls to require.

Tom
  

Patch

diff --git a/gdb/testsuite/gdb.btrace/buffer-size.exp b/gdb/testsuite/gdb.btrace/buffer-size.exp
index f1185050b40..fc784070cca 100644
--- a/gdb/testsuite/gdb.btrace/buffer-size.exp
+++ b/gdb/testsuite/gdb.btrace/buffer-size.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/data.exp b/gdb/testsuite/gdb.btrace/data.exp
index bb1f80cc629..7afbcd4af3b 100644
--- a/gdb/testsuite/gdb.btrace/data.exp
+++ b/gdb/testsuite/gdb.btrace/data.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/delta.exp b/gdb/testsuite/gdb.btrace/delta.exp
index e2a69ad6e33..4dfceff1561 100644
--- a/gdb/testsuite/gdb.btrace/delta.exp
+++ b/gdb/testsuite/gdb.btrace/delta.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/enable-new-thread.exp b/gdb/testsuite/gdb.btrace/enable-new-thread.exp
index 39b3455fbd2..73fe4a40eb6 100644
--- a/gdb/testsuite/gdb.btrace/enable-new-thread.exp
+++ b/gdb/testsuite/gdb.btrace/enable-new-thread.exp
@@ -17,10 +17,7 @@ 
 
 # Test that new threads of recorded inferiors also get recorded.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads}] {
diff --git a/gdb/testsuite/gdb.btrace/enable-running.exp b/gdb/testsuite/gdb.btrace/enable-running.exp
index d2e010708c0..35b56444262 100644
--- a/gdb/testsuite/gdb.btrace/enable-running.exp
+++ b/gdb/testsuite/gdb.btrace/enable-running.exp
@@ -15,10 +15,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
diff --git a/gdb/testsuite/gdb.btrace/enable.exp b/gdb/testsuite/gdb.btrace/enable.exp
index 0a7fae778b5..99f6b2eba92 100644
--- a/gdb/testsuite/gdb.btrace/enable.exp
+++ b/gdb/testsuite/gdb.btrace/enable.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # start fresh - without an executable
 gdb_exit
diff --git a/gdb/testsuite/gdb.btrace/exception.exp b/gdb/testsuite/gdb.btrace/exception.exp
index 8533ee875bf..798fb5a137f 100755
--- a/gdb/testsuite/gdb.btrace/exception.exp
+++ b/gdb/testsuite/gdb.btrace/exception.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # We expect a specific function call history.  This gets messed up with
 # PIE on 32-bit.
diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp
index 9ff8bf93736..5d81bc097e9 100644
--- a/gdb/testsuite/gdb.btrace/function_call_history.exp
+++ b/gdb/testsuite/gdb.btrace/function_call_history.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # We expect a specific function call history.  This gets messed up with
 # PIE on 32-bit.
diff --git a/gdb/testsuite/gdb.btrace/gcore.exp b/gdb/testsuite/gdb.btrace/gcore.exp
index 08ad8d53356..9284f3633f3 100644
--- a/gdb/testsuite/gdb.btrace/gcore.exp
+++ b/gdb/testsuite/gdb.btrace/gcore.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/instruction_history.exp b/gdb/testsuite/gdb.btrace/instruction_history.exp
index 415bcf8e308..5559922bb03 100644
--- a/gdb/testsuite/gdb.btrace/instruction_history.exp
+++ b/gdb/testsuite/gdb.btrace/instruction_history.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile .c .S
 if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
diff --git a/gdb/testsuite/gdb.btrace/multi-inferior.exp b/gdb/testsuite/gdb.btrace/multi-inferior.exp
index e10fda32fba..1354ae10819 100644
--- a/gdb/testsuite/gdb.btrace/multi-inferior.exp
+++ b/gdb/testsuite/gdb.btrace/multi-inferior.exp
@@ -22,10 +22,7 @@ 
 #
 # Each inferior can be recorded separately.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 if { [use_gdb_stub] } {
     unsupported "test creates multiple inferiors"
diff --git a/gdb/testsuite/gdb.btrace/multi-thread-step.exp b/gdb/testsuite/gdb.btrace/multi-thread-step.exp
index 2fdd7c2c6ca..34d4a0f9046 100644
--- a/gdb/testsuite/gdb.btrace/multi-thread-step.exp
+++ b/gdb/testsuite/gdb.btrace/multi-thread-step.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
diff --git a/gdb/testsuite/gdb.btrace/nohist.exp b/gdb/testsuite/gdb.btrace/nohist.exp
index 4d6e5814638..2651bb7ac0e 100644
--- a/gdb/testsuite/gdb.btrace/nohist.exp
+++ b/gdb/testsuite/gdb.btrace/nohist.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/non-stop.exp b/gdb/testsuite/gdb.btrace/non-stop.exp
index 40dfd54f640..1b76ec41a60 100644
--- a/gdb/testsuite/gdb.btrace/non-stop.exp
+++ b/gdb/testsuite/gdb.btrace/non-stop.exp
@@ -15,10 +15,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
diff --git a/gdb/testsuite/gdb.btrace/reconnect.exp b/gdb/testsuite/gdb.btrace/reconnect.exp
index cc55f73cd17..4b9e7d7c921 100644
--- a/gdb/testsuite/gdb.btrace/reconnect.exp
+++ b/gdb/testsuite/gdb.btrace/reconnect.exp
@@ -19,10 +19,7 @@ 
 
 load_lib gdbserver-support.exp
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 if { [skip_gdbserver_tests] } {
     unsupported "target does not support gdbserver"
     return -1
diff --git a/gdb/testsuite/gdb.btrace/record_goto-step.exp b/gdb/testsuite/gdb.btrace/record_goto-step.exp
index 8c4ac1bdfc8..422145fb138 100644
--- a/gdb/testsuite/gdb.btrace/record_goto-step.exp
+++ b/gdb/testsuite/gdb.btrace/record_goto-step.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/record_goto.exp b/gdb/testsuite/gdb.btrace/record_goto.exp
index b6db2a709c8..c65a5fe6131 100644
--- a/gdb/testsuite/gdb.btrace/record_goto.exp
+++ b/gdb/testsuite/gdb.btrace/record_goto.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # The "record goto" command jumps to a specific instruction in the execution
 # trace.  To guarantee that we always get the same execution trace, we use
diff --git a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
index eb486b33124..efea6e51398 100644
--- a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
+++ b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp
@@ -21,10 +21,7 @@ 
 # Test that we can reverse-next over the dynamic linker's symbol
 # lookup code.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile \
diff --git a/gdb/testsuite/gdb.btrace/segv.exp b/gdb/testsuite/gdb.btrace/segv.exp
index 4e66444475d..e18cf8ff5e3 100644
--- a/gdb/testsuite/gdb.btrace/segv.exp
+++ b/gdb/testsuite/gdb.btrace/segv.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/step.exp b/gdb/testsuite/gdb.btrace/step.exp
index e372b2ee631..942cb51c530 100644
--- a/gdb/testsuite/gdb.btrace/step.exp
+++ b/gdb/testsuite/gdb.btrace/step.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile record_goto.c
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.btrace/stepi.exp b/gdb/testsuite/gdb.btrace/stepi.exp
index a8c3f8c511e..33b788c10d3 100644
--- a/gdb/testsuite/gdb.btrace/stepi.exp
+++ b/gdb/testsuite/gdb.btrace/stepi.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # This test is stepping on instruction level.  To guarantee that we always
 # get the same execution trace, we use an assembly source file.
diff --git a/gdb/testsuite/gdb.btrace/tailcall-only.exp b/gdb/testsuite/gdb.btrace/tailcall-only.exp
index 6cd4afa4fe9..e2163ea1577 100644
--- a/gdb/testsuite/gdb.btrace/tailcall-only.exp
+++ b/gdb/testsuite/gdb.btrace/tailcall-only.exp
@@ -20,10 +20,7 @@ 
 # calls.  This used to cause a crash in get_frame_type.
 #
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # This test requires the compiler to generate a tail call.  To guarantee that
 # we always get one, we use an assembly source file.
diff --git a/gdb/testsuite/gdb.btrace/tailcall.exp b/gdb/testsuite/gdb.btrace/tailcall.exp
index 63a57c8772b..e6cf0fea450 100644
--- a/gdb/testsuite/gdb.btrace/tailcall.exp
+++ b/gdb/testsuite/gdb.btrace/tailcall.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 # This test requires the compiler to generate a tail call.  To guarantee that
 # we always get one, we use an assembly source file.
diff --git a/gdb/testsuite/gdb.btrace/unknown_functions.exp b/gdb/testsuite/gdb.btrace/unknown_functions.exp
index 798bd7cb07a..5ae612e4c28 100644
--- a/gdb/testsuite/gdb.btrace/unknown_functions.exp
+++ b/gdb/testsuite/gdb.btrace/unknown_functions.exp
@@ -17,10 +17,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.btrace/vdso.exp b/gdb/testsuite/gdb.btrace/vdso.exp
index 39789598cf5..a334318301a 100644
--- a/gdb/testsuite/gdb.btrace/vdso.exp
+++ b/gdb/testsuite/gdb.btrace/vdso.exp
@@ -20,10 +20,7 @@ 
 #
 # Test that we can access the vdso memory during replay for stepping.
 
-if { [skip_btrace_tests] } {
-    unsupported "target does not support record-btrace"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
diff --git a/gdb/testsuite/gdb.python/py-record-btrace-threads.exp b/gdb/testsuite/gdb.python/py-record-btrace-threads.exp
index 7827e5aaee8..a6160a5caf1 100644
--- a/gdb/testsuite/gdb.python/py-record-btrace-threads.exp
+++ b/gdb/testsuite/gdb.python/py-record-btrace-threads.exp
@@ -17,10 +17,7 @@ 
 
 # Skip this test if btrace is disabled.
 
-if { [skip_btrace_tests] } {
-    untested "skipping btrace tests"
-    return -1
-}
+require !skip_btrace_tests
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp
index bbaf268c86a..f95044a8dc6 100644
--- a/gdb/testsuite/gdb.python/py-record-btrace.exp
+++ b/gdb/testsuite/gdb.python/py-record-btrace.exp
@@ -17,10 +17,7 @@ 
 
 # Skip this test if btrace is disabled.
 
-if { [skip_btrace_tests] } {
-    untested "skipping btrace tests"
-    return -1
-}
+require !skip_btrace_tests
 
 load_lib gdb-python.exp