Message ID | 20221217000818.3729389-36-tom@tromey.com |
---|---|
State | Committed |
Headers | |
Series | Rewrite "require" test procedure and use it more often | |
Commit Message
diff --git a/gdb/testsuite/gdb.btrace/reconnect.exp b/gdb/testsuite/gdb.btrace/reconnect.exp index 4b9e7d7c921..5d74c7997d3 100644 --- a/gdb/testsuite/gdb.btrace/reconnect.exp +++ b/gdb/testsuite/gdb.btrace/reconnect.exp @@ -20,10 +20,7 @@ load_lib gdbserver-support.exp require !skip_btrace_tests -if { [skip_gdbserver_tests] } { - unsupported "target does not support gdbserver" - return -1 -} +require !skip_gdbserver_tests standard_testfile if [prepare_for_testing "failed to prepare" $testfile $srcfile] { diff --git a/gdb/testsuite/gdb.mi/mi-file-transfer.exp b/gdb/testsuite/gdb.mi/mi-file-transfer.exp index 5c5ea02a428..27a26542265 100644 --- a/gdb/testsuite/gdb.mi/mi-file-transfer.exp +++ b/gdb/testsuite/gdb.mi/mi-file-transfer.exp @@ -20,9 +20,7 @@ load_lib gdbserver-support.exp load_lib mi-support.exp set MIFLAGS "-i=mi" -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests standard_testfile basics.c diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp index dd98b718368..9bd21172a7a 100644 --- a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp +++ b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp @@ -22,9 +22,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests require can_spawn_for_attach diff --git a/gdb/testsuite/gdb.python/py-send-packet.exp b/gdb/testsuite/gdb.python/py-send-packet.exp index 5cb2f5a656c..f6c90dd5039 100644 --- a/gdb/testsuite/gdb.python/py-send-packet.exp +++ b/gdb/testsuite/gdb.python/py-send-packet.exp @@ -24,9 +24,7 @@ load_lib gdbserver-support.exp standard_testfile -if {[skip_gdbserver_tests]} { - return 0 -} +require !skip_gdbserver_tests if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 diff --git a/gdb/testsuite/gdb.server/abspath.exp b/gdb/testsuite/gdb.server/abspath.exp index e0d0c2c00e0..15b9681ecc0 100644 --- a/gdb/testsuite/gdb.server/abspath.exp +++ b/gdb/testsuite/gdb.server/abspath.exp @@ -22,9 +22,7 @@ load_lib gdbserver-support.exp standard_testfile normal.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests # Because we're relying on being able to change our CWD before # executing gdbserver, we just run if we're not testing with a remote diff --git a/gdb/testsuite/gdb.server/attach-flag.exp b/gdb/testsuite/gdb.server/attach-flag.exp index 2e3456a7fcb..e799dc4daf6 100644 --- a/gdb/testsuite/gdb.server/attach-flag.exp +++ b/gdb/testsuite/gdb.server/attach-flag.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests require can_spawn_for_attach diff --git a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp index 452c7c93db3..33b03e53ff2 100644 --- a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp +++ b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile server.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if { [prepare_for_testing "failed to prepare" ${binfile} "${srcfile}" \ {debug pthreads}] } { diff --git a/gdb/testsuite/gdb.server/connect-stopped-target.exp b/gdb/testsuite/gdb.server/connect-stopped-target.exp index d2cef37dbb3..35651ca9a9c 100644 --- a/gdb/testsuite/gdb.server/connect-stopped-target.exp +++ b/gdb/testsuite/gdb.server/connect-stopped-target.exp @@ -20,9 +20,7 @@ load_lib gdbserver-support.exp load_lib prelink-support.exp -if {[skip_gdbserver_tests]} { - return -} +require !skip_gdbserver_tests standard_testfile set executable ${testfile} diff --git a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp index 9b47f21106f..3c9dc80c989 100644 --- a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp +++ b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp @@ -25,9 +25,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if { [build_executable "failed to prepare" $testfile $srcfile debug] } { return -1 diff --git a/gdb/testsuite/gdb.server/connect-without-multi-process.exp b/gdb/testsuite/gdb.server/connect-without-multi-process.exp index c4bbcac72fa..b05542c8a0f 100644 --- a/gdb/testsuite/gdb.server/connect-without-multi-process.exp +++ b/gdb/testsuite/gdb.server/connect-without-multi-process.exp @@ -18,9 +18,7 @@ load_lib gdbserver-support.exp -if {[skip_gdbserver_tests]} { - return -} +require !skip_gdbserver_tests standard_testfile diff --git a/gdb/testsuite/gdb.server/exit-multiple-threads.exp b/gdb/testsuite/gdb.server/exit-multiple-threads.exp index 23ac512ef70..a43263fa5ed 100644 --- a/gdb/testsuite/gdb.server/exit-multiple-threads.exp +++ b/gdb/testsuite/gdb.server/exit-multiple-threads.exp @@ -25,10 +25,7 @@ load_lib gdbserver-support.exp -if { [skip_gdbserver_tests] } { - verbose "skipping gdbserver tests" - return -1 -} +require !skip_gdbserver_tests standard_testfile diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp index 16e4abe083f..9e0045ad1fd 100644 --- a/gdb/testsuite/gdb.server/ext-attach.exp +++ b/gdb/testsuite/gdb.server/ext-attach.exp @@ -22,9 +22,7 @@ load_lib trace-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests require can_spawn_for_attach diff --git a/gdb/testsuite/gdb.server/ext-restart.exp b/gdb/testsuite/gdb.server/ext-restart.exp index ac03caa0aaf..63e4b2fb954 100644 --- a/gdb/testsuite/gdb.server/ext-restart.exp +++ b/gdb/testsuite/gdb.server/ext-restart.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile server.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests save_vars { GDBFLAGS } { # If GDB and GDBserver are both running locally, set the sysroot to avoid diff --git a/gdb/testsuite/gdb.server/ext-run.exp b/gdb/testsuite/gdb.server/ext-run.exp index cfc31e25be9..95cb135726f 100644 --- a/gdb/testsuite/gdb.server/ext-run.exp +++ b/gdb/testsuite/gdb.server/ext-run.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile server.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { return -1 diff --git a/gdb/testsuite/gdb.server/ext-wrapper.exp b/gdb/testsuite/gdb.server/ext-wrapper.exp index 4c6cea4cd89..099538d48ca 100644 --- a/gdb/testsuite/gdb.server/ext-wrapper.exp +++ b/gdb/testsuite/gdb.server/ext-wrapper.exp @@ -19,9 +19,7 @@ load_lib gdbserver-support.exp standard_testfile wrapper.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { return -1 diff --git a/gdb/testsuite/gdb.server/file-transfer.exp b/gdb/testsuite/gdb.server/file-transfer.exp index 310effd44b6..5d069c89502 100644 --- a/gdb/testsuite/gdb.server/file-transfer.exp +++ b/gdb/testsuite/gdb.server/file-transfer.exp @@ -20,9 +20,7 @@ load_lib gdbserver-support.exp standard_testfile server.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 diff --git a/gdb/testsuite/gdb.server/monitor-exit-quit.exp b/gdb/testsuite/gdb.server/monitor-exit-quit.exp index fdf24520989..59aa69823e8 100644 --- a/gdb/testsuite/gdb.server/monitor-exit-quit.exp +++ b/gdb/testsuite/gdb.server/monitor-exit-quit.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile server.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { return -1 diff --git a/gdb/testsuite/gdb.server/multi-ui-errors.exp b/gdb/testsuite/gdb.server/multi-ui-errors.exp index 45a2dabbd6c..f56a58ca4c5 100644 --- a/gdb/testsuite/gdb.server/multi-ui-errors.exp +++ b/gdb/testsuite/gdb.server/multi-ui-errors.exp @@ -24,9 +24,7 @@ load_lib gdbserver-support.exp standard_testfile -if {[skip_gdbserver_tests]} { - return 0 -} +require !skip_gdbserver_tests save_vars { GDBFLAGS } { # If GDB and GDBserver are both running locally, set the sysroot to avoid diff --git a/gdb/testsuite/gdb.server/no-thread-db.exp b/gdb/testsuite/gdb.server/no-thread-db.exp index 16c1a0d9ca1..8fe225966a4 100644 --- a/gdb/testsuite/gdb.server/no-thread-db.exp +++ b/gdb/testsuite/gdb.server/no-thread-db.exp @@ -25,9 +25,7 @@ load_lib gdbserver-support.exp standard_testfile set unresolvable_thread_db_path "/foo/bar" -if {[skip_gdbserver_tests]} { - return 0 -} +require !skip_gdbserver_tests if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { return -1 diff --git a/gdb/testsuite/gdb.server/non-existing-program.exp b/gdb/testsuite/gdb.server/non-existing-program.exp index e1226f11969..01d3b206c45 100644 --- a/gdb/testsuite/gdb.server/non-existing-program.exp +++ b/gdb/testsuite/gdb.server/non-existing-program.exp @@ -22,9 +22,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests set gdbserver [find_gdbserver] if { $gdbserver == "" } { diff --git a/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp b/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp index 70b4dbf4340..9d354b771ef 100644 --- a/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp +++ b/gdb/testsuite/gdb.server/reconnect-ctrl-c.exp @@ -19,10 +19,7 @@ load_lib gdbserver-support.exp -if { [skip_gdbserver_tests] } { - verbose "skipping gdbserver tests" - return -1 -} +require !skip_gdbserver_tests if [target_info exists gdb,nointerrupts] { verbose "Skipping reconnect-ctrl-c.exp because of nointerrupts." diff --git a/gdb/testsuite/gdb.server/run-without-local-binary.exp b/gdb/testsuite/gdb.server/run-without-local-binary.exp index fb4beca6c92..f0ac47921d3 100644 --- a/gdb/testsuite/gdb.server/run-without-local-binary.exp +++ b/gdb/testsuite/gdb.server/run-without-local-binary.exp @@ -15,9 +15,7 @@ load_lib gdbserver-support.exp -if {[skip_gdbserver_tests]} { - return -} +require !skip_gdbserver_tests standard_testfile normal.c diff --git a/gdb/testsuite/gdb.server/server-connect.exp b/gdb/testsuite/gdb.server/server-connect.exp index 806f034cc57..33df2b8a4d6 100644 --- a/gdb/testsuite/gdb.server/server-connect.exp +++ b/gdb/testsuite/gdb.server/server-connect.exp @@ -22,9 +22,7 @@ load_lib gdbserver-support.exp standard_testfile normal.c -if {[skip_gdbserver_tests]} { - return 0 -} +require !skip_gdbserver_tests # We want to have control over where we start gdbserver. if { [is_remote target] } { diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp index 9f7938c8390..ef21f3144a2 100644 --- a/gdb/testsuite/gdb.server/server-kill-python.exp +++ b/gdb/testsuite/gdb.server/server-kill-python.exp @@ -23,9 +23,7 @@ load_lib gdbserver-support.exp standard_testfile multi-ui-errors.c -if {[skip_gdbserver_tests]} { - return 0 -} +require !skip_gdbserver_tests # Gdb needs to be running for skip_python_tests, but exit once we're done, # we'll start a custom gdb after this. diff --git a/gdb/testsuite/gdb.server/server-kill.exp b/gdb/testsuite/gdb.server/server-kill.exp index 93daf482907..509828c8e5b 100644 --- a/gdb/testsuite/gdb.server/server-kill.exp +++ b/gdb/testsuite/gdb.server/server-kill.exp @@ -22,9 +22,7 @@ load_lib gdbserver-support.exp standard_testfile -if {[skip_gdbserver_tests]} { - return 0 -} +require !skip_gdbserver_tests if { [build_executable "failed to prepare" ${testfile}] } { return -1 diff --git a/gdb/testsuite/gdb.server/server-mon.exp b/gdb/testsuite/gdb.server/server-mon.exp index 0cec9ccb418..d993f6bd010 100644 --- a/gdb/testsuite/gdb.server/server-mon.exp +++ b/gdb/testsuite/gdb.server/server-mon.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile server.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 diff --git a/gdb/testsuite/gdb.server/server-pipe.exp b/gdb/testsuite/gdb.server/server-pipe.exp index 83537378aa6..833c05e6bba 100644 --- a/gdb/testsuite/gdb.server/server-pipe.exp +++ b/gdb/testsuite/gdb.server/server-pipe.exp @@ -32,9 +32,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests set gdbserver [find_gdbserver] if { $gdbserver == "" } { diff --git a/gdb/testsuite/gdb.server/server-run.exp b/gdb/testsuite/gdb.server/server-run.exp index 5e99cfd1fbd..a5523e619ab 100644 --- a/gdb/testsuite/gdb.server/server-run.exp +++ b/gdb/testsuite/gdb.server/server-run.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile server.c -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { return -1 diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp index 3bc7cbed52e..535717d0cf6 100644 --- a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp +++ b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp @@ -30,10 +30,7 @@ load_lib gdbserver-support.exp -if { [skip_gdbserver_tests] } { - verbose "skipping gdbserver tests" - return -1 -} +require !skip_gdbserver_tests standard_testfile if { [build_executable "failed to prepare" $testfile $srcfile {debug pthreads}] == -1 } { diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp index 488a5859961..41b727b77d7 100644 --- a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp +++ b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp @@ -22,10 +22,7 @@ load_lib gdbserver-support.exp -if { [skip_gdbserver_tests] } { - verbose "skipping gdbserver tests" - return -1 -} +require !skip_gdbserver_tests standard_testfile if { [build_executable "failed to prepare" $testfile $srcfile] == -1 } { diff --git a/gdb/testsuite/gdb.server/sysroot.exp b/gdb/testsuite/gdb.server/sysroot.exp index 95679fc0849..bda7f8aff4a 100644 --- a/gdb/testsuite/gdb.server/sysroot.exp +++ b/gdb/testsuite/gdb.server/sysroot.exp @@ -20,10 +20,7 @@ load_lib gdbserver-support.exp -if { [skip_gdbserver_tests] } { - verbose "skipping gdbserver tests" - return -1 -} +require !skip_gdbserver_tests standard_testfile if {[build_executable "failed to prepare" $testfile $srcfile "additional_flags=--no-builtin"] == -1} { diff --git a/gdb/testsuite/gdb.server/twice-connect.exp b/gdb/testsuite/gdb.server/twice-connect.exp index c892a0f80a9..369b4510a0f 100644 --- a/gdb/testsuite/gdb.server/twice-connect.exp +++ b/gdb/testsuite/gdb.server/twice-connect.exp @@ -19,9 +19,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if { [build_executable "failed to prepare" $::testfile $::srcfile \ {debug}] } { diff --git a/gdb/testsuite/gdb.server/unittest.exp b/gdb/testsuite/gdb.server/unittest.exp index d083ef25487..e5ca7b1db86 100644 --- a/gdb/testsuite/gdb.server/unittest.exp +++ b/gdb/testsuite/gdb.server/unittest.exp @@ -19,9 +19,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests global server_spawn_id diff --git a/gdb/testsuite/gdb.server/wrapper.exp b/gdb/testsuite/gdb.server/wrapper.exp index fed33aa1731..80b32fc2a5e 100644 --- a/gdb/testsuite/gdb.server/wrapper.exp +++ b/gdb/testsuite/gdb.server/wrapper.exp @@ -21,9 +21,7 @@ load_lib gdbserver-support.exp standard_testfile -if { [skip_gdbserver_tests] } { - return 0 -} +require !skip_gdbserver_tests if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } {