]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use "require" for Python tests
authorTom Tromey <tom@tromey.com>
Sat, 7 Jan 2023 19:18:59 +0000 (12:18 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 13 Jan 2023 20:18:57 +0000 (13:18 -0700)
This changes various tests to use "require" for the Python feature.

100 files changed:
gdb/testsuite/gdb.ada/pp-rec-component.exp
gdb/testsuite/gdb.ada/py_range.exp
gdb/testsuite/gdb.ada/py_taft.exp
gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp
gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp
gdb/testsuite/gdb.dwarf2/symtab-producer.exp
gdb/testsuite/gdb.gdb/python-helper.exp
gdb/testsuite/gdb.python/compare-enum-type.exp
gdb/testsuite/gdb.python/flexible-array-member.exp
gdb/testsuite/gdb.python/lib-types.exp
gdb/testsuite/gdb.python/pretty-print-call-by-hand.exp
gdb/testsuite/gdb.python/py-arch-reg-groups.exp
gdb/testsuite/gdb.python/py-arch-reg-names.exp
gdb/testsuite/gdb.python/py-arch.exp
gdb/testsuite/gdb.python/py-as-string.exp
gdb/testsuite/gdb.python/py-auto-load-chaining.exp
gdb/testsuite/gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp
gdb/testsuite/gdb.python/py-bad-printers.exp
gdb/testsuite/gdb.python/py-block.exp
gdb/testsuite/gdb.python/py-bp-locations.exp
gdb/testsuite/gdb.python/py-breakpoint-create-fail.exp
gdb/testsuite/gdb.python/py-breakpoint.exp
gdb/testsuite/gdb.python/py-caller-is.exp
gdb/testsuite/gdb.python/py-charset.exp
gdb/testsuite/gdb.python/py-cmd.exp
gdb/testsuite/gdb.python/py-completion.exp
gdb/testsuite/gdb.python/py-connection-removed.exp
gdb/testsuite/gdb.python/py-connection.exp
gdb/testsuite/gdb.python/py-disasm.exp
gdb/testsuite/gdb.python/py-doc-reformat.exp
gdb/testsuite/gdb.python/py-error.exp
gdb/testsuite/gdb.python/py-event-load.exp
gdb/testsuite/gdb.python/py-events.exp
gdb/testsuite/gdb.python/py-evsignal.exp
gdb/testsuite/gdb.python/py-evthreads.exp
gdb/testsuite/gdb.python/py-explore-cc.exp
gdb/testsuite/gdb.python/py-explore.exp
gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.exp
gdb/testsuite/gdb.python/py-finish-breakpoint.exp
gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
gdb/testsuite/gdb.python/py-format-address.exp
gdb/testsuite/gdb.python/py-format-string.exp
gdb/testsuite/gdb.python/py-frame-args.exp
gdb/testsuite/gdb.python/py-frame-inline.exp
gdb/testsuite/gdb.python/py-frame.exp
gdb/testsuite/gdb.python/py-framefilter-addr.exp
gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp
gdb/testsuite/gdb.python/py-framefilter.exp
gdb/testsuite/gdb.python/py-function.exp
gdb/testsuite/gdb.python/py-inferior-leak.exp
gdb/testsuite/gdb.python/py-inferior.exp
gdb/testsuite/gdb.python/py-infthread.exp
gdb/testsuite/gdb.python/py-label-symbol-value.exp
gdb/testsuite/gdb.python/py-lazy-string.exp
gdb/testsuite/gdb.python/py-linetable.exp
gdb/testsuite/gdb.python/py-lookup-type.exp
gdb/testsuite/gdb.python/py-mi-events.exp
gdb/testsuite/gdb.python/py-mi-objfile.exp
gdb/testsuite/gdb.python/py-mi-var-info-path-expression.exp
gdb/testsuite/gdb.python/py-nested-maps.exp
gdb/testsuite/gdb.python/py-objfile-script.exp
gdb/testsuite/gdb.python/py-objfile.exp
gdb/testsuite/gdb.python/py-parameter.exp
gdb/testsuite/gdb.python/py-pending-frame-level.exp
gdb/testsuite/gdb.python/py-pp-integral.exp
gdb/testsuite/gdb.python/py-pp-maint.exp
gdb/testsuite/gdb.python/py-pp-re-notag.exp
gdb/testsuite/gdb.python/py-pp-registration.exp
gdb/testsuite/gdb.python/py-prettyprint.exp
gdb/testsuite/gdb.python/py-progspace.exp
gdb/testsuite/gdb.python/py-prompt.exp
gdb/testsuite/gdb.python/py-rbreak.exp
gdb/testsuite/gdb.python/py-record-btrace-threads.exp
gdb/testsuite/gdb.python/py-record-btrace.exp
gdb/testsuite/gdb.python/py-record-full.exp
gdb/testsuite/gdb.python/py-recurse-unwind.exp
gdb/testsuite/gdb.python/py-rvalue-ref-value-cc.exp
gdb/testsuite/gdb.python/py-section-script.exp
gdb/testsuite/gdb.python/py-send-packet.exp
gdb/testsuite/gdb.python/py-shared.exp
gdb/testsuite/gdb.python/py-startup-opt.exp
gdb/testsuite/gdb.python/py-strfns.exp
gdb/testsuite/gdb.python/py-symbol.exp
gdb/testsuite/gdb.python/py-symtab.exp
gdb/testsuite/gdb.python/py-sync-interp.exp
gdb/testsuite/gdb.python/py-template.exp
gdb/testsuite/gdb.python/py-thrhandle.exp
gdb/testsuite/gdb.python/py-typeprint.exp
gdb/testsuite/gdb.python/py-unwind-inline.exp
gdb/testsuite/gdb.python/py-unwind-maint.exp
gdb/testsuite/gdb.python/py-unwind-user-regs.exp
gdb/testsuite/gdb.python/py-unwind.exp
gdb/testsuite/gdb.python/py-value-cc.exp
gdb/testsuite/gdb.python/py-value.exp
gdb/testsuite/gdb.python/py-xmethods.exp
gdb/testsuite/gdb.python/tui-window-names.exp
gdb/testsuite/gdb.python/tui-window.exp
gdb/testsuite/gdb.rust/pp.exp
gdb/testsuite/gdb.server/server-kill-python.exp
gdb/testsuite/gdb.threads/tls.exp

index f5963fff799eb69b7200aa609d850a3cb001a337..b57bde330cfaf161b57926a78b1db1f6e43fc8bd 100644 (file)
@@ -15,7 +15,7 @@
 
 load_lib "ada.exp"
 
-require !skip_ada_tests
+require !skip_ada_tests !skip_python_tests
 
 standard_ada_testfile foo
 
@@ -25,9 +25,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
 
 clean_restart ${testfile}
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set remote_python_file \
     [gdb_remote_download host ${srcdir}/${subdir}/${gdb_test_file_name}.py]
 gdb_test_no_output "source ${remote_python_file}" \
index d1a84b617fa484ab817b8329560be14301fc9230..b2c91fb4e3c0f32b70046c10a3a70bffa3575db9 100644 (file)
@@ -16,7 +16,7 @@
 load_lib "ada.exp"
 load_lib gdb-python.exp
 
-require !skip_ada_tests
+require !skip_ada_tests !skip_python_tests
 
 standard_ada_testfile foo
 
@@ -26,9 +26,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
 
 clean_restart ${testfile}
 
-# Skip this testcase if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
 runto "foo.adb:$bp_location"
 
index ea9e7b1db5cce6ea5b97112afcae5b879c31223f..543bc728e3ce569019120ad49ce648c4ce1cfec4 100644 (file)
@@ -16,7 +16,7 @@
 load_lib "ada.exp"
 load_lib gdb-python.exp
 
-require !skip_ada_tests
+require !skip_ada_tests !skip_python_tests
 
 standard_ada_testfile main
 
@@ -26,9 +26,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
 
 clean_restart ${testfile}
 
-# Skip this testcase if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set bp_location [gdb_get_line_number "STOP" ${testdir}/main.adb]
 runto "main.adb:$bp_location"
 
index f525b1af33a54657a4cf854983066e290c5e6d91..88e95d13ae228ab0ced0e755d3a1ade1eb4a53d4 100644 (file)
 
 standard_testfile
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
-# Skip this test if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index e21ff2efab90e568e27d5a9f988420a71259734a..f5c55f584258dfe860e13a6a1994ebde3fa7164b 100644 (file)
@@ -36,6 +36,8 @@
 
 standard_testfile .c
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
@@ -44,9 +46,6 @@ if {![runto_main]} {
     return 0
 }
 
-# Skip this test if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
 gdb_test_no_output "source ${pyfile}" "load python file"
 
index 50cb428dae5eafd38c0103c2282ed6ac443ff38b..545d76f124640f9606f77b8c4cc4eb644a12c0d8 100644 (file)
@@ -17,10 +17,7 @@ load_lib dwarf.exp
 load_lib gdb-python.exp
 
 # This test can only be run on targets which support DWARF-2 and use gas.
-require dwarf2_support
-
-# This test can also only be run when we have python support in gdb,
-# but that test can only be done after gdb has started, below.
+require dwarf2_support !skip_python_tests
 
 standard_testfile main.c -dw.S
 
@@ -87,9 +84,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
 
 set GDBFLAGS $saved_gdbflags
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_py_test_silent_cmd "python with_producer = gdb.lookup_global_symbol(\"with_producer\")" \
     "get with_producer symbol" 0
 
index d6c316caf858f5cf27c4957120d994477eb980fc..3c0e2e5730449affc9c5e29faa6a7b9cbef341bd 100644 (file)
@@ -24,6 +24,8 @@ if [target_info exists gdb,noinferiorio] {
     return
 }
 
+require !skip_python_tests
+
 standard_testfile .cc
 
 if { [build_executable "failed to build" $testfile $srcfile {debug c++}] } {
@@ -38,14 +40,6 @@ if { ![file readable $py_helper_script] \
     return
 }
 
-# Start GDB and check that we have python support.
-gdb_start
-if { [skip_python_tests] } {
-    untested "skipped gdb-gdb.py tests due to lack of python support"
-    return
-}
-gdb_exit
-
 # The main test.  This is called by the self-test framework once GDB
 # has been started on a copy of itself.
 proc test_python_helper {} {
index 8d5d65e25f6e3dc678d2da73d57837b0bcb2d1f7..0cc6bd93daa25ee8f6b006885bee29c93e58f5ac 100644 (file)
 
 standard_testfile -a.c -b.c
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" "compare-enum-type" \
          [list $srcfile $srcfile2]] } {
     return
 }
 
-if { [skip_python_tests] } { continue }
-
 gdb_test "py print(gdb.parse_and_eval('e1').type == gdb.parse_and_eval('e2').type)" "True"
index bed3c972d94c548c737d708c28a098c9e5fb2a37..23f1da067a5c8a084089fc0df3ad7a40c27fc1af 100644 (file)
 
 standard_testfile
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" \
        ${testfile} ${srcfile}] } {
     return
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if { ![runto break_here] } {
     untested "could not run to break_here"
     return
index bf3aff1e2e31f56e83f983016bcd4ec87e000199..92359c941a69be8d9ca6beb5aa0f835d9eeba3bc 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index f58044e273d6796441d25c15c42e432a3086caca..64414a3c23baa3fe7d3db7e2ddb9fdd7fb74b443 100644 (file)
 
 load_lib gdb-python.exp
 
-standard_testfile
-
-# gdb needs to be started here for skip_python_tests to work.
-# prepare_for_testing could be used instead, but it could compile the program
-# unnecessarily, so starting GDB like this is preferable.
-gdb_start
+require !skip_python_tests
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
+standard_testfile
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
     untested "failed to compile"
index a4cafdccdc880c24e71597f6ee1701a678a53dd2..5a0077d020d66596d4ecbe1f0aa24f7b9f0642f6 100644 (file)
 # Check the gdb.Architecture.register_groups functionality.
 
 load_lib gdb-python.exp
+require !skip_python_tests
 standard_testfile py-arch.c
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index 67ceeff09b8042c1ed52be543eef2b8a00f8ae8b..73e41401f51a5255139ef53c5b8ea26fcbfb7047 100644 (file)
 # Check the gdb.Architecture.registers functionality.
 
 load_lib gdb-python.exp
+require !skip_python_tests
 standard_testfile py-arch.c
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index e9967ae000647f890e4a61719fde07c89067b189..449613bc0fb152595d20e6edc964056635f4a0c4 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 load_lib gdb-python.exp
+require !skip_python_tests
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index 9ae6f5d929a3c1d29c34feb932838873b7432ddc..8bf248a59adb037376e63ce78de2e199f0e18107 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
@@ -28,8 +30,6 @@ if ![runto_main] {
     return 0
 }
 
-if { [skip_python_tests] } { continue }
-
 proc test_as_string { } {
     gdb_test "p \$_as_string(2)" "\"2\""
     gdb_test "p \$_as_string(enum_valid)" "\"ENUM_VALUE_B\""
index 9b7b0b5c202f120417c2f846c70921d3a7bda5a4..aac6eb305b9455bca815d22c72ddc1836459d3e5 100644 (file)
@@ -19,6 +19,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile .c -f1.c -f2.c
 
 # Two additional object files needed for this test.
@@ -47,9 +49,6 @@ if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index 97a0f24732b59e53867e9bb3fd4c69e6505abf29..a67ae48b316f21ac104e2108f43d31382ca8a251 100644 (file)
@@ -19,6 +19,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile -main.cc
 
 set srcfile_lib "${testfile}-lib.cc"
@@ -27,12 +29,6 @@ set libname "lib${testfile}"
 set python_autoload_file "${srcdir}/${subdir}/${libname}.so-gdb.py"
 set binfile_lib [standard_output_file "${libname}.so"]
 
-# Start GDB first - needed for skip_python_tests.
-clean_restart
-
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # Compile library.
 if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} \
       {debug c++}] != "" } {
@@ -47,6 +43,8 @@ if { [gdb_compile ${srcdir}/${subdir}/${srcfile} \
     return -1
 }
 
+clean_restart
+
 # Make the -gdb.py script available to gdb, it is automatically loaded by
 # gdb if it is put in the same directory as the library.
 set remote_python_autoload_file \
index 7249639dc7c3819357e2db8e9d1c5ef716426083..26e6a97916c1f96dd24ed6892aa9ced537cbb953 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return -1
 }
index bbf9eafa10bc6ef7d16e6d83f605dddcb40fd992..90c3b4d0fb086cc07769b66ae3b58781031fdcf3 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index a3894436b2c3be66498f62af8d6397a93f25a8bd..55aca67eb9dc6dbf01a352e76eb3556a2003f275 100644 (file)
@@ -15,6 +15,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } {
@@ -25,8 +27,6 @@ save_vars { GDBFLAGS } {
     clean_restart $testfile
 }
 
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
     return -1
 }
index ec9d553dc0e493a0cb9a8b1cbf8cb37653643caf..6c1a262ad4752cdfc24dff0694c21e0cd1839157 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 clean_restart "${testfile}"
 if ![runto_main] {
     return
index 49c097952063537b9f9c71f17cb6f6eb7cf90943..0995ae49ead70783a133b1f8f8974d9d49364d58 100644 (file)
@@ -26,6 +26,8 @@ set skip_hw_watchpoint_tests_p [skip_hw_watchpoint_tests]
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 set options {debug c++}
@@ -34,9 +36,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${options}]
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 proc_with_prefix test_bkpt_basic { } {
     global srcfile testfile hex decimal
 
index d1bf56fda67a2ddd19f706b5c2bd7348bba478e4..66e0ce516e4be4adad34e899180d6654178a2c0d 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
@@ -28,9 +30,6 @@ if ![runto_main] {
     return 0
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_breakpoint "bottom_func"
 gdb_continue_to_breakpoint "bottom_func"
 
index b49617823baab94b462737a5b73489416c5839e0..9e831954cddf5bcd806e993dfafe0b66cf190513 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # Each test data has 4 parts:
 # 1. The string used in 'show XXX-charset' command,
 # 2. The string expected in the output of the command used in #1,
index 707068899faa2be4775485920326155dd60104fd..0eb785f6d4d775b9898d0b57e91105ffe267e23c 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index f466853353fb8a27036020667911edf46a995d55..bf1abf32ee257c157cbc1aae5fc2c9a6d891aacd 100644 (file)
@@ -17,14 +17,13 @@ set testfile "py-completion"
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
 set discard 0
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # Tab completion tests require readline support, and this set of tests
 # doesn't work on a remote host either.
 if { [readline_is_used] && ![is_remote host] } {
index 8ffd99567ac988393132e5be05a2361a7de841de..efbcf46516ff1c9723b1d9158c975a56d69cf300 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile py-connection.c
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] then {
     return 0
 }
index 0719fe3b1f69dab599f70ce1f1190c93bba354ae..78710fd27dee4f99d83cb5093978cdeeb709676e 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index 3aa77d44b61c680ef40c69a8bf41b75fa72d8b52..57f8fdfce41d7789685d9c2a38eccae70a4627e1 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} "debug"] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     fail "can't run to main"
     return 0
index 5af64d61d5dfb5aaba87d5131eae2f961ac781f2..3829873c4cc504f6626d826d24b314312e7de7cf 100644 (file)
@@ -19,9 +19,9 @@
 
 load_lib gdb-python.exp
 
-# Check that Python is supported.
+require !skip_python_tests
+
 clean_restart
-if { [skip_python_tests] } { continue }
 
 # A global counter used to number the tests.
 set idx 0
index b04be6a774f0fb810c7340689689410848eb5b36..0a8fd190c180091b4302823f93ec36666235784e 100644 (file)
@@ -20,13 +20,12 @@ set testfile "py-error"
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 # Start with a fresh gdb.
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set charset "IBM1047"
 
 set test2 "main reached"
index 8dce6f19e5a04d23db4c751bdc6c192b1c00fec4..f36312511480e4b1b6a066e15ad155a6ba4582b7 100644 (file)
@@ -18,7 +18,7 @@
 
 load_lib gdb-python.exp
 
-require !skip_shlib_tests
+require !skip_shlib_tests !skip_python_tests
 
 if {[get_compiler_info]} {
     warning "Could not get compiler info"
@@ -49,8 +49,6 @@ if {![runto_main]} {
     return
 }
 
-if { [skip_python_tests] } { return }
-
 gdb_test_no_output "set var libname = \"$binfile2_dlopen\""
 
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-event-load.py]
index 109f8c1ca4e83094fe3cf20719cb4d3d447a0ccf..ea1a6f502ffefeccce38125835c22a0e31bc7f0f 100644 (file)
@@ -13,7 +13,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/>.
 
-require !use_gdb_stub
+require !use_gdb_stub !skip_python_tests
 
 load_lib gdb-python.exp
 
@@ -34,8 +34,6 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
 # Start with a fresh gdb.
 clean_restart ${testfile}
 
-if { [skip_python_tests] } { continue }
-
 gdb_test_no_output "python import gdb.events"
 
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-events.py]
index 03e2f8b0f80f374b147830ff9a68f6fe5102e466..2f0e791884e619b71420af60feaf897a75918e3f 100644 (file)
@@ -22,6 +22,8 @@ if {[target_info gdb_protocol] == "remote"
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile py-evthreads.c
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
@@ -29,8 +31,6 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 }
 clean_restart $testfile
 
-if { [skip_python_tests] } { continue }
-
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-events.py]
 gdb_test_no_output "source ${pyfile}" "load python file"
 
index fde5501b1db9035396abe1eb9015579f861f0627..e993c6fe9b28b841882aa86a68d2eb5792dbb727 100644 (file)
@@ -13,7 +13,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/>.
 
-require support_displaced_stepping
+require support_displaced_stepping !skip_python_tests
 
 load_lib gdb-python.exp
 
@@ -28,8 +28,6 @@ save_vars { GDBFLAGS } {
     clean_restart $testfile
 }
 
-if { [skip_python_tests] } { continue }
-
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-events.py]
 gdb_test_no_output "source ${pyfile}" "load python file"
 
index bb42b56b5a8ff091ee4de5b21139e9e91d951fdc..d3678cf71ca884b1ff44eb918dd9265ca58a1859 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-require !skip_cplus_tests
+require !skip_cplus_tests !skip_python_tests
 
 standard_testfile py-explore.cc
 
@@ -24,9 +24,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set int_ptr_ref_desc "The value of 'int_ptr_ref' is of type 'int_ptr' which is a typedef of type 'int \\*'.*\'int_ptr_ref' is a pointer to a value of type 'int'.*"
 
 set b_desc "The value of 'b' is a struct/class of type 'B' with the following fields:.*\
index 8b6e677446bfc72fa124bc5e0a02b81806357d03..dd36740bac593c02420185868c8b1a686f7cc16a 100644 (file)
 
 standard_testfile
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set SS "struct SimpleStruct"
 set SU "union SimpleUnion"
 set CS "struct ComplexStruct"
index 7855714c7815de96b7e6c5eca1b50b1d787594b1..d414268b1cb14730fef9362a5e9e819c36573e62 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] then {
     return 0
 }
index 7cc2c40a2991f10d40dde114013a4c553a554aba..d37508c7d5c691fe9a9d8b057f923ce422ba2681 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-require !skip_shlib_tests
+require !skip_shlib_tests !skip_python_tests
 
 load_lib gdb-python.exp
 
@@ -37,8 +37,6 @@ if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
 # Start with a fresh gdb.
 clean_restart ${testfile}
 
-if { [skip_python_tests] } { continue }
-
 #
 # Test FinishBreakpoint in normal conditions
 #
index 7eb394ee29a22e03df9f61e1f27c47615f4ab1c8..300020553a10d703ade3c0325fc32e944036c55f 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index c90acad56c889ca5eb63f16a00d58abfb6fce595..d9fed3f6ef2225fa38b5848f37b15a1b9a4607c4 100644 (file)
@@ -14,6 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 load_lib gdb-python.exp
+require !skip_python_tests
 standard_testfile
 
 foreach func_name { foo bar } {
@@ -31,9 +32,6 @@ set binary_bar [standard_output_file "${testfile}-bar"]
 
 clean_restart $binary_foo
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index 6599fe318762245ee9042d7ab4c43013122c492c..30a57b2254f784aab59bf864dd26669ad1b77e6a 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
-# Skip all tests if Python scripting is not enabled.
 gdb_exit
 gdb_start
-if { [skip_python_tests] } { continue }
 
 # Build inferior to language specification.
 proc build_inferior {exefile lang} {
index 2ecc80ddae8858e00ab5f212a2d746cdea2e377b..091e26dd5b193c456b50f2dcd79caa48498ddd33 100644 (file)
 
 standard_testfile
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
     return -1
 }
index d755c663fe8e49b407a19f6c0ad0ba85d1690dbc..719ec18aa37c1f1cc43ba8882111ef5ac622e083 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index fca732cf142be2fddcfc7854ac4559a5f6639d6c..f17e2f9844a6b8a453790e54f626d15d347c8ffb 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # The following tests require execution.
 
 if {![runto_main]} {
index 2cda4e596e860943b31e9af7a84426b72e6d56c9..5dad3bd0f2d6b97aab60f896c47fed37e3ba0880 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index 43bb53540aead4314170f7fa006fb87b5b9f4a5a..86a830d5eef9a7fa05a9bc0f88de00c36c8fa6a2 100644 (file)
@@ -15,6 +15,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile amd64-py-framefilter-invalidarg.S
 
 if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
@@ -32,9 +34,6 @@ if {[build_executable $testfile.exp $testfile $srcfile {}] == -1} {
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # Make the -gdb.py script available to gdb, it is automagically loaded by gdb.
 # Care is taken to put it in the same directory as the binary so that
 # gdb will find it.
index ac214fc6cbcf28be0d52829868484d5f8cc501fd..81101c11809ea0b85048f34ddacfade384723e0c 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 # We cannot use prepare_for_testing as we have to set the safe-patch
@@ -30,9 +32,6 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_test "info frame-filter" \
     "No frame filters\\." \
     "info frame filter before loading filters"
@@ -291,9 +290,6 @@ if {[build_executable $testfile.exp $testfile $srcfile {nodebug}] == -1} {
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # Make the -gdb.py script available to gdb, it is automagically loaded by gdb.
 # Care is taken to put it in the same directory as the binary so that
 # gdb will find it.
index 358a0855fb888b1257fbf01cd6a2a51952df922f..7c48f7a0bd849d342bee6d115f52e1e4628563ee 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 # Start with a fresh gdb.
 
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_test_multiline "input convenience function" \
   "python" "" \
   "class test_func (gdb.Function):" "" \
index 1eff7ae031689a3f76d671c92c25779f0cbc1377..4e2fa64154598f46884a0e51e2c0ab35178d00cf 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 clean_restart
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { return }
-
 # Skip this test if the tracemalloc module is not available.
 if { ![gdb_py_module_available "tracemalloc"] } {
     unsupported "tracemalloc module not available"
index ee6b9fc97c53decc8c4cba0617c1a4a534dc2c5b..0286d82394c374a00bf7bf4c83af246e137c20b4 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [gdb_compile_pthreads ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
@@ -27,9 +29,6 @@ if { [gdb_compile_pthreads ${srcdir}/${subdir}/${srcfile} ${binfile} executable
 # Start with a fresh gdb.
 clean_restart ${testfile}
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 switch [get_endianness] {
     little { set python_pack_char "<" }
     big { set python_pack_char ">" }
index 4e468bfef18e757ff4353d59d364c1ab78597cff..47c6b19dbfcebf2d311a5dc88d090e1fb03664b1 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_test_multiline "install new_thread event handler" \
     "python" "" \
     "seen_a_thread = False" "" \
index 3aea2bb4f2cd90bb2ccb7c4561f322b4963b0b0d..f3e91b74a46773ff705b12552e4144e1eec52578 100644 (file)
 # symbol (i.e. a symbol for a goto label).
 
 load_lib gdb-python.exp
+require !skip_python_tests
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index 57c6c1c87b76de0454bdc96b64113e69fa80ab9e..9f3bad5c66071e27f55836d1b8a2fcfdc72c2d55 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main ] {
     return -1
 }
index 19c3e7456766d2fac995cf205814f822568de859..ff438216cf356ba8bef4a96bbdfe1e48aa0bf90e 100644 (file)
@@ -14,6 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 load_lib gdb-python.exp
+require !skip_python_tests
 set opts {}
 standard_testfile .S
 
@@ -34,9 +35,6 @@ if ![runto_main] {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_py_test_silent_cmd "python lt = gdb.selected_frame().find_sal().symtab.linetable()" \
     "get instruction" 0
 
index d81b3520b5ca3080752ae0bf5fce60da1220b9a3..7527c13a925f27171b3b84ee84588c13c2f592f9 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 # Note that the purpose of this testcase is to test the behavior
 # of gdb.lookup_type searching for the primitive types internally
 # created by each language since GDB.  So, we must start GDB without
@@ -27,9 +29,6 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 proc test_lookup_type { lang type_name } {
     gdb_test_no_output "set language ${lang}"
     gdb_test "python print(gdb.lookup_type('${type_name}').name)" \
index d3ffb154d910a1991e8d5b68f85361a669d96027..4ed3405730a20c3ba8e98613a57632f664d57baf 100644 (file)
@@ -18,6 +18,8 @@
 load_lib mi-support.exp
 set MIFLAGS "-i=mi2"
 
+require !skip_python_tests
+
 gdb_exit
 if [mi_gdb_start] {
     return
@@ -31,8 +33,6 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
     return -1
 }
 
-if { [skip_python_tests] } { return }
-
 set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${pyfile}]
 
 mi_delete_breakpoints
index 2aaf65d0b7c7f47641f578f02e01ac82d830ebe6..1b258623fb86a73f3e581ca0c5c1f0af05143b27 100644 (file)
@@ -18,6 +18,8 @@
 load_lib mi-support.exp
 set MIFLAGS "-i=mi2"
 
+require !skip_python_tests
+
 gdb_exit
 if [mi_gdb_start] {
     return
@@ -31,8 +33,6 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
     return -1
 }
 
-if { [skip_python_tests] } { return }
-
 # Make the -gdb.py script available to gdb, it is automagically loaded by gdb.
 # Care is taken to put it in the same directory as the binary so that
 # gdb will find it.
index 77227b60e34beab7b0d5d637f8442b5689e536de..b618b08e393afd33dd52e14764c0a57879eff50e 100644 (file)
@@ -18,6 +18,8 @@
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
+require !skip_python_tests
+
 #
 # Start here
 #
@@ -29,9 +31,6 @@ if {[gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable {debug}] != "" }
 
 mi_clean_restart $binfile
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
 mi_gdb_test "source ${pyfile}" \
   ".*\\^done" \
index 35cb1007bb5edad88d3e2df50840e11cae92884f..76e38c2555cc30a26de5851418208f5ed3e2d36c 100644 (file)
 
 load_lib gdb-python.exp
 
-standard_testfile
-
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
+require !skip_python_tests
 
 standard_testfile
 
index 33068a72c8c2675b2a58fb1cf8384f4a987d42a6..550a68447b8dc1b5f6d4d7ee8fec85bf959d8e4b 100644 (file)
@@ -18,6 +18,8 @@
 
 standard_testfile
 
+require !skip_python_tests
+
 if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
 }
@@ -26,9 +28,6 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # Make the -gdb.py script available to gdb, it is automagically loaded by gdb.
 # Care is taken to put it in the same directory as the binary so that
 # gdb will find it.
index 811db0c7eb93f04419a21915fda9d798be448869..cf9d5aedc19e2dc9acd8523e284b01a0dd6e9bd8 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index 3a117072e3a5e1b2bcf74fe673b715ee0fe6bfb7..ab99817b5f3fd637ad2e0bb32d3f2e67c5fb922c 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 # Start with a fresh gdb.
 clean_restart
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 proc py_param_test_maybe_no_output { command pattern args } {
     if [string length $pattern] {
        gdb_test $command $pattern $args
index a00a23c40c22c0264cad959b6a11f0d956959e70..b83eaa31095d1b0827a354d59869eaea215eb31c 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index a576bcb0f39eaa8386a6f9aaf4293a91e332bc5c..3fa247661aef60df061eb0c61497ebc6edd59297 100644 (file)
 
 standard_testfile
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto tick_tock] {
     return -1
 }
index 7e8afa4d49bf36841590178dc17fa51f875bb5bd..5e6f23aeb9d366f40a70ae7e4db434f7a939661a 100644 (file)
@@ -23,15 +23,14 @@ if [is_remote host] {
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return -1
 }
index a576bcb0f39eaa8386a6f9aaf4293a91e332bc5c..3fa247661aef60df061eb0c61497ebc6edd59297 100644 (file)
 
 standard_testfile
 
+require !skip_python_tests
+
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto tick_tock] {
     return -1
 }
index 32bd2acf5ec2bba7f99b367ed33e082388853663..c85fc4a1a79418b9bd70656e84399d1e325552e5 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set remote_python_file [gdb_remote_download host \
                            ${srcdir}/${subdir}/${testfile}.py]
 
index bdd92ec4bfd1ac9aa8273b56c305b091ac346f7d..8166e118693bbe40c5352f6fdab7b686b217acd4 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 # Start with a fresh gdb.
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 proc run_lang_tests {exefile lang} {
     global srcdir subdir srcfile testfile hex
     if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" executable "debug $lang"] != "" } {
index 33460b80b32dd2376104533c2c7d3ffdd6d9e02f..23b328aa680876e8a48a479ab96c19ebae23c5e2 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
@@ -30,9 +32,6 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_test "python print (gdb.current_progspace().filename)" "None" \
   "current progspace filename (None)"
 gdb_test "python print (gdb.progspaces())" "\\\[<gdb.Progspace object at $hex>\\\]"
index 03a730bcd469084fd6461276ba7ea878d7e4c140..56a0b47c78d621642430345a777241fbea9d84c6 100644 (file)
@@ -21,15 +21,7 @@ standard_testfile
 load_lib gdb-python.exp
 load_lib prompt.exp
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-gdb_exit
+require !skip_python_tests
 
 if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
index 2d39141285ff63f1fb540b92785fd02b0d2f7d0d..6c5f77ef3b1c09c6d05985d5173a69526c918d83 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile py-rbreak.c py-rbreak-func2.c
 
 if {[prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile2]] } {
     return 1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index ef14edcededce1777c4360995e4dbea40abe91f9..f0845f8bbd50ce14e219a57d54cf75ddd0b53726 100644 (file)
@@ -15,9 +15,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Skip this test if btrace is disabled.
+load_lib gdb-python.exp
 
-require !skip_btrace_tests
+require !skip_btrace_tests !skip_python_tests
 
 standard_testfile
 
@@ -27,14 +27,6 @@ if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {deb
 }
 clean_restart $testfile
 
-# Skip this test if python is disabled.
-
-load_lib gdb-python.exp
-if { [skip_python_tests] } {
-    untested "skipping python tests"
-    return -1
-}
-
 if { ![runto_main] } {
     return -1
 }
index 38c326f555f67560a48c5536064dd6cde16a4acc..1326e8283b9b3b69f1d1850c5d99d2c9ed37692a 100644 (file)
@@ -17,7 +17,7 @@
 
 # Skip this test if btrace is disabled.
 
-require !skip_btrace_tests
+require !skip_btrace_tests !skip_python_tests
 
 load_lib gdb-python.exp
 
@@ -25,13 +25,6 @@ standard_testfile
 
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] { return -1 }
 
-# Skip this test if python is disabled.
-
-if { [skip_python_tests] } {
-    untested "skipping python tests"
-    return -1
-}
-
 if {![runto_main]} {
     return -1
 }
index fe19d6b207c60442afdf2c145c267a6cdb23b0b8..eb40d51f21895b99c314615bc35b61f5d05137ac 100644 (file)
@@ -17,7 +17,7 @@
 
 # Skip this test if target does not support recording.
 
-require supports_process_record
+require supports_process_record !skip_python_tests
 
 load_lib gdb-python.exp
 
@@ -25,13 +25,6 @@ standard_testfile
 
 if [prepare_for_testing "failed to prepare" $testfile $srcfile] { return -1 }
 
-# Skip this test if python is disabled.
-
-if { [skip_python_tests] } {
-    untested "skipping python tests"
-    return -1
-}
-
 if {![runto_main]} {
     return -1
 }
index 6e623933f6c850e82c06a0f96f9782d2c3bc2767..498443e9e549f25503efce233ee260b1bb5aa9db 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
 
 gdb_test "source ${pyfile}" "Python script imported" \
index 98eb94f5d2c329c6ddef173dc96583ec6d707087..66a010108f4fb3600df8ac475c56a74abf2ee95e 100644 (file)
@@ -17,7 +17,7 @@
 # exposing rvalue reference values to Python.  It is based on
 # gdb.python/py-value-cc.exp.
 
-require !skip_cplus_tests
+require !skip_cplus_tests !skip_python_tests
 
 standard_testfile .cc
 
@@ -26,9 +26,6 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile \
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if {[skip_python_tests]} { continue }
-
 if {![runto_main]} {
    return -1
 }
index d3d2a6ccd6066a3fcea7356f41d74be6aa4ee39f..96dafdbfd678c95842cf2b49b64442ecce14edeb 100644 (file)
@@ -28,6 +28,8 @@ if {![istarget *-*-linux*]
     return
 }
 
+require !skip_python_tests
+
 standard_testfile
 
 # Make this available to gdb before the program starts, it is
@@ -48,9 +50,6 @@ if {[build_executable $testfile.exp $testfile $srcfile \
 gdb_exit
 gdb_start
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 gdb_reinitialize_dir $srcdir/$subdir
 
 # Try first with a restrictive safe-path.
index c6305ed6291a2a5234750c0dd8a494ab7b46b106..e09dbb05fd48533133fc0f511787c93439c346ab 100644 (file)
@@ -24,16 +24,12 @@ load_lib gdbserver-support.exp
 
 standard_testfile
 
-require !skip_gdbserver_tests
+require !skip_gdbserver_tests !skip_python_tests
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if { [skip_python_tests] } {
-    return 0
-}
-
 # Make sure we're disconnected, in case we're testing with an
 # extended-remote board, therefore already connected.
 gdb_test "disconnect" ".*"
index ac68e2cbd07256289d96e63440f93a58a5b46386..fdec1df2cc89852444b8e503fba59625626a125a 100644 (file)
@@ -17,7 +17,7 @@
 
 load_lib gdb-python.exp
 
-require !skip_shlib_tests
+require !skip_shlib_tests !skip_python_tests
 
 standard_testfile
 
@@ -41,9 +41,6 @@ if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $exec_opt
 clean_restart $testfile
 gdb_load_shlib ${library}
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # The following tests require execution.
 
 if {![runto_main]} {
index 89f97fd729c851a79c77b6a2c725a20d1276cf83..2d9fd2a04443deb7f0382debc9b1d35f695ca8a9 100644 (file)
 # Test the flags within GDB that can be used to control how Python is
 # initialized.
 
-gdb_start
-
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
-gdb_exit
+require !skip_python_tests
 
 # Return a list containing two directory paths for newly created home
 # directories.
index 94d71800584f04ce2d1b7ab208d29f59d74a7cb5..162e1026eb5fa0f1f343ea71c9326b00bf91b954 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
@@ -28,9 +30,6 @@ if ![runto_main] {
     return 0
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 proc test_all_strfns { } {
     gdb_test "p \$_streq (str1, str2)" " = 1"
     gdb_test "p \$_streq (str1, str3)" " = 0"
index d2192bf5d88d9199696365e47f9005154437ee0a..a0bf34d8aa1f902c007257ad5237846334d06040 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile py-symbol.c py-symbol-2.c
 
 set opts { debug additional_flags=-DUSE_TWO_FILES }
@@ -26,9 +28,6 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set readnow_p [readnow]
 
 # Check that we find all static symbols before the inferior has
index 43d693e16f3c93b5460aa7b85b5f42143c66eeda..5b68524140efe88ad4b807c6409ea6f8c5e560d5 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile py-symbol.c
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index 408a165e64863cafd2901ea73211019460c40c39..1e994bf7393878275285f0f3f6775a57fa3d9755 100644 (file)
 
 standard_testfile
 
-require can_spawn_for_attach
+require can_spawn_for_attach !skip_python_tests
 
 load_lib gdb-python.exp
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-gdb_exit
-
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
index 1383e3a1089a5733d2134ff1f7e61fa182f6240f..14ebb67018849301d3ef9ee601eceabfca204478 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-require !skip_cplus_tests
+require !skip_cplus_tests !skip_python_tests
 
 standard_testfile .cc
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
@@ -31,9 +31,6 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 proc test_template_arg {exefile type} {
     global testfile srcdir subdir srcfile
     if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" \
index d8fa2e6f1a2547a51af4a3fdc4e2096033d45421..0806f8995c17c4af4236f0f4a58e861e65ae585f 100644 (file)
@@ -21,6 +21,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
@@ -29,9 +31,6 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 
 clean_restart ${binfile}
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 runto_main
 
 gdb_test "break after_mc_barrier" \
index abf95e5c4863f59ae74e251e9705df0f4c8c5718..37e292948053226721588201d06badff57552e41 100644 (file)
@@ -13,7 +13,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/>.
 
-require !skip_cplus_tests
+require !skip_cplus_tests !skip_python_tests
 
 load_lib gdb-python.exp
 load_lib cp-support.exp
@@ -24,8 +24,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if { [skip_python_tests] } { continue }
-
 set remote_python_file [gdb_remote_download host \
                            ${srcdir}/${subdir}/${testfile}.py]
 
index 964d90a75f23a670e074a9094e891e4a47d4f167..c0dc7f2f49b9dbb84b2a89284c5acedd4e1c9a38 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
@@ -25,9 +27,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # The following tests require execution.
 if {![runto_main]} {
     return 0
index f0506691ec25a30114e2cc39a297c5593e29b85b..3fcbe4f60549c660e8a07f08c169a8b2db77543a 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
 
 if {![runto_main]} {
index c62d4f0bde82a40874ab6ba7d3d7635fc12020be..1598f86569907b062aaded93d440611c0c42826b 100644 (file)
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if {![runto_main]} {
     return 0
 }
index 1810214082a87247af912b00d75fd1a576a34a4a..2d279bf71b15c38824ac883f0581e0c5baf8653a 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 # Stack protection can make the stack look a bit different, breaking the
@@ -29,9 +31,6 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} "debug $fla
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 # This test runs on a specific platform.
 if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { continue }
 
index f62c1df4aa58bcbe34a4a441ea0555f7577355e0..4085a87440ee2e7159872f095dbb721ca00f9c17 100644 (file)
@@ -16,7 +16,7 @@
 # This file is part of the GDB testsuite.  It tests the mechanism
 # exposing values to Python.
 
-require !skip_cplus_tests
+require !skip_cplus_tests !skip_python_tests
 
 standard_testfile .cc
 
@@ -24,9 +24,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 if ![runto_main] {
    return -1
 }
index a4964e11dd271b4a2316680bbae08a503874d47c..8ab188c7ea5d84da459c06324a7d390c539e5ed1 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 standard_testfile
 
 set has_argv0 [gdb_has_argv0]
@@ -634,9 +636,6 @@ if { [build_inferior "${binfile}" "c"] < 0 } {
 # Start with a fresh gdb.
 clean_restart ${binfile}
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 test_history_count
 test_value_creation
 test_value_reinit
index 8db5c39080b847ed562051fe578d241a96b9652b..6a9e5f22dc1db14b8b0ec613c0f389ebf3cff977 100644 (file)
@@ -18,7 +18,7 @@
 
 load_lib gdb-python.exp
 
-require !skip_cplus_tests
+require !skip_cplus_tests !skip_python_tests
 
 standard_testfile py-xmethods.cc
 
@@ -26,12 +26,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } {
-    untested "skipping Python tests"
-    return
-}
-
 if ![runto_main] {
    return -1
 }
index 9fcd86491173d37e7e49f1eb4adae4d022efde0b..48f3c6b07cd64593bd9ac20258dc11f2b437c26b 100644 (file)
@@ -18,6 +18,8 @@
 
 load_lib gdb-python.exp
 
+require !skip_python_tests
+
 tuiterm_env
 
 clean_restart
@@ -26,11 +28,6 @@ if {[skip_tui_tests]} {
     return
 }
 
-if { [skip_python_tests] } {
-    untested "skipping Python tests"
-    return
-}
-
 # Define a function we can use as a window constructor.  If this ever
 # gets called we'll throw an error, but that's OK, this test doesn't
 # actually try to create any windows.
index 1dd8e373c24377f8ab2047af3e21bcd2a92af71b..2f0415557bd26fc1afb69c5f3471551e4391e82a 100644 (file)
@@ -16,6 +16,7 @@
 # Test a TUI window implemented in Python.
 
 load_lib gdb-python.exp
+require !skip_python_tests
 tuiterm_env
 
 # This test doesn't care about the inferior.
@@ -32,9 +33,6 @@ if {[skip_tui_tests]} {
 
 Term::clean_restart 24 80 $testfile
 
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
 set remote_python_file [gdb_remote_download host \
                            ${srcdir}/${subdir}/${testfile}.py]
 gdb_test_no_output "source ${remote_python_file}" \
index a456afc1b35d2b59a98d77f5441587668675f6ff..d23463e89dd05fb56329d6f4aaf94758c11000f8 100644 (file)
 
 load_lib gdb-python.exp
 load_lib rust-support.exp
-require !skip_rust_tests
+require !skip_rust_tests !skip_python_tests
 
 standard_testfile .rs
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
     return -1
 }
 
-if { [skip_python_tests] } { return }
-
 set remote_python_file [gdb_remote_download host \
                            ${srcdir}/${subdir}/${testfile}.py]
 gdb_test_no_output "source ${remote_python_file}" "load python file"
index 1eb9e2e51c538e3af5dc0ad3ca12b7ebf3c1bb2a..4ef70daaf90306a22324f4e71416ed4f4c4eb5aa 100644 (file)
@@ -23,15 +23,7 @@ load_lib gdbserver-support.exp
 
 standard_testfile multi-ui-errors.c
 
-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.
-clean_restart
-if { [skip_python_tests] } {
-    return 0
-}
-gdb_exit
+require !skip_gdbserver_tests !skip_python_tests
 
 if {[build_executable "failed to prepare" ${testfile} \
         ${srcfile}] == -1} {
index d2c55db0cac8db2a5d9d0d1e63d58dbf7d0b44fc..78ce9879b42c6438235d3a5eaf371d775d961e3a 100644 (file)
@@ -72,7 +72,7 @@ proc check_thread_local {number} {
            "= $expected_value" \
            "${number} thread local storage"
 
-    if {!$::has_python_support} {
+    if {![skip_python_tests]} {
        gdb_test_no_output \
            "python sym = gdb.lookup_symbol('a_thread_local')\[0\]" \
            "${number} look up a_thread_local symbol"
@@ -155,9 +155,6 @@ proc check_thread_stack {number spin_threads spin_threads_level} {
 
 clean_restart ${binfile}
 
-# Set this to avoid calling skip_python_tests repeatedly.
-set has_python_support [skip_python_tests]
-
 gdb_test_multiple "print a_thread_local" "" {
     -re -wrap "Cannot find thread-local variables on this target" {
        kfail "gdb/25807" $gdb_test_name