This changes various tests to use "require" for the Python feature.
load_lib "ada.exp"
-require !skip_ada_tests
+require !skip_ada_tests !skip_python_tests
standard_ada_testfile foo
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}" \
load_lib "ada.exp"
load_lib gdb-python.exp
-require !skip_ada_tests
+require !skip_ada_tests !skip_python_tests
standard_ada_testfile foo
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"
load_lib "ada.exp"
load_lib gdb-python.exp
-require !skip_ada_tests
+require !skip_ada_tests !skip_python_tests
standard_ada_testfile main
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"
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
}
standard_testfile .c
+require !skip_python_tests
+
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
return -1
}
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"
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
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
return
}
+require !skip_python_tests
+
standard_testfile .cc
if { [build_executable "failed to build" $testfile $srcfile {debug c++}] } {
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 {} {
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"
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
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
}
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"
# 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
}
# 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
}
# 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
}
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
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\""
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile .c -f1.c -f2.c
# Two additional object files needed for this test.
return -1
}
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
if ![runto_main] {
return -1
}
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile -main.cc
set srcfile_lib "${testfile}-lib.cc"
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++}] != "" } {
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 \
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
}
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
}
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } {
clean_restart $testfile
}
-if { [skip_python_tests] } { continue }
-
if ![runto_main] {
return -1
}
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
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
set options {debug c++}
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
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
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"
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,
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
}
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] } {
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
}
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
}
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
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
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"
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"
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]
# 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
# 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]
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile py-evthreads.c
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
}
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"
# 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
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"
# 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
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:.*\
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"
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
}
# 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
# Start with a fresh gdb.
clean_restart ${testfile}
-if { [skip_python_tests] } { continue }
-
#
# Test FinishBreakpoint in normal conditions
#
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
}
# 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 } {
clean_restart $binary_foo
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
if ![runto_main] {
return -1
}
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} {
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
}
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
}
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]} {
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
}
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile amd64-py-framefilter-invalidarg.S
if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
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.
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
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"
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.
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):" "" \
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"
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
if { [gdb_compile_pthreads ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
# 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 ">" }
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" "" \
# 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
}
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
}
# 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
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
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
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)" \
load_lib mi-support.exp
set MIFLAGS "-i=mi2"
+require !skip_python_tests
+
gdb_exit
if [mi_gdb_start] {
return
return -1
}
-if { [skip_python_tests] } { return }
-
set remote_python_file [gdb_remote_download host ${srcdir}/${subdir}/${pyfile}]
mi_delete_breakpoints
load_lib mi-support.exp
set MIFLAGS "-i=mi2"
+require !skip_python_tests
+
gdb_exit
if [mi_gdb_start] {
return
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.
load_lib mi-support.exp
set MIFLAGS "-i=mi"
+require !skip_python_tests
+
#
# Start here
#
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" \
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
standard_testfile
+require !skip_python_tests
+
if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
return -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.
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
}
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
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
}
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
}
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
}
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
}
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]
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"] != "" } {
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
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>\\\]"
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
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
}
# 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
}
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
}
# Skip this test if btrace is disabled.
-require !skip_btrace_tests
+require !skip_btrace_tests !skip_python_tests
load_lib gdb-python.exp
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
}
# 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
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
}
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" \
# 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
return -1
}
-# Skip all tests if Python scripting is not enabled.
-if {[skip_python_tests]} { continue }
-
if {![runto_main]} {
return -1
}
return
}
+require !skip_python_tests
+
standard_testfile
# Make this available to gdb before the program starts, it is
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.
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" ".*"
load_lib gdb-python.exp
-require !skip_shlib_tests
+require !skip_shlib_tests !skip_python_tests
standard_testfile
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]} {
# 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.
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
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"
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 }
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
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
}
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
}
# 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 \
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}" \
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
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" \
# 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
return -1
}
-if { [skip_python_tests] } { continue }
-
set remote_python_file [gdb_remote_download host \
${srcdir}/${subdir}/${testfile}.py]
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]} {
return 0
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]} {
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
}
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
# Stack protection can make the stack look a bit different, breaking the
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 }
# 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
return -1
}
-# Skip all tests if Python scripting is not enabled.
-if { [skip_python_tests] } { continue }
-
if ![runto_main] {
return -1
}
load_lib gdb-python.exp
+require !skip_python_tests
+
standard_testfile
set has_argv0 [gdb_has_argv0]
# 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
load_lib gdb-python.exp
-require !skip_cplus_tests
+require !skip_cplus_tests !skip_python_tests
standard_testfile py-xmethods.cc
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
}
load_lib gdb-python.exp
+require !skip_python_tests
+
tuiterm_env
clean_restart
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.
# 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.
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}" \
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"
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} {
"= $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"
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