Use "require" for Python tests

This changes various tests to use "require" for the Python feature.
This commit is contained in:
Tom Tromey 2023-01-07 12:18:59 -07:00
parent d394684d55
commit 79749205e7
100 changed files with 170 additions and 374 deletions

View 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}" \

View 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"

View 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"

View file

@ -51,13 +51,12 @@
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
}

View 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"

View 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

View 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 {} {

View file

@ -17,11 +17,11 @@
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"

View file

@ -17,14 +17,13 @@
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

View file

@ -18,15 +18,14 @@
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
}

View file

@ -19,16 +19,10 @@
load_lib gdb-python.exp
require !skip_python_tests
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
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
untested "failed to compile"
return -1

View file

@ -16,15 +16,13 @@
# 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
}

View file

@ -16,15 +16,13 @@
# 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
}

View file

@ -13,15 +13,13 @@
# 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
}

View 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\""

View 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
}

View 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 \

View file

@ -18,15 +18,14 @@
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
}

View file

@ -18,15 +18,14 @@
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
}

View 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
}

View file

@ -18,15 +18,14 @@
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

View 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

View 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"

View file

@ -15,12 +15,11 @@
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,

View file

@ -18,15 +18,14 @@
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
}

View 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] } {

View file

@ -25,15 +25,14 @@
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
}

View file

@ -20,15 +20,14 @@
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
}

View file

@ -18,15 +18,14 @@
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

View 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

View 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"

View 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]

View 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]

View 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"

View 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"

View 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:.*\

View file

@ -15,13 +15,12 @@
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"

View file

@ -17,15 +17,14 @@
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
}

View 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
#

View file

@ -18,15 +18,14 @@
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
}

View 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
}

View file

@ -18,12 +18,12 @@
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} {

View file

@ -15,13 +15,12 @@
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
}

View file

@ -15,15 +15,14 @@
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
}

View file

@ -18,15 +18,14 @@
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]} {

View file

@ -19,15 +19,14 @@
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
}

View 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.

View 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.

View file

@ -18,15 +18,14 @@
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):" "" \

View file

@ -18,13 +18,12 @@
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"

View 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 ">" }

View file

@ -18,15 +18,14 @@
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" "" \

View file

@ -17,15 +17,13 @@
# 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
}

View file

@ -18,15 +18,14 @@
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
}

View 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

View 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)" \

View 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

View 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.

View 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" \

View file

@ -19,14 +19,7 @@
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

View 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.

View file

@ -18,15 +18,14 @@
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
}

View file

@ -18,12 +18,11 @@
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

View file

@ -17,15 +17,14 @@
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
}

View file

@ -15,13 +15,12 @@
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
}

View 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
}

View file

@ -15,13 +15,12 @@
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
}

View file

@ -18,15 +18,14 @@
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]

View file

@ -18,15 +18,14 @@
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"] != "" } {

View 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>\\\]"

View 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

View file

@ -18,15 +18,14 @@
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
}

View 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
}

View 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
}

View 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
}

View file

@ -24,15 +24,14 @@
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" \

View 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
}

View 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.

View 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" ".*"

View 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]} {

View file

@ -16,12 +16,7 @@
# 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.

View 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"

View 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

View file

@ -18,15 +18,14 @@
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
}

View file

@ -20,20 +20,10 @@
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
}

View 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}" \

View 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" \

View 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]

View 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

View file

@ -18,15 +18,14 @@
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]} {

View file

@ -38,15 +38,14 @@
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
}

View 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 }

View 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
}

View 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

View 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
}

View 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.

View 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}" \

View file

@ -17,15 +17,13 @@
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"

View 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} {

View 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