prepare_for_testing.
* gdb.python/py-block.exp: Use standard_testfile.
* gdb.python/py-breakpoint.exp: Use standard_testfile.
* gdb.python/py-events.exp: Use standard_testfile,
standard_output_file.
* gdb.python/py-evsignal.exp: Use standard_testfile.
* gdb.python/py-evethreads.exp: Use standard_testfile.
* gdb.python/py-explore-cc.exp: Use standard_testfile.
* gdb.python/py-explore.exp: Use standard_testfile.
* gdb.python/py-finish-breakpoint.exp: Use standard_testfile,
standard_output_file.
* gdb.python/py-finish-breakpoint2.exp: Use standard_testfile,
prepare_for_testing.
* gdb.python/py-frame-inline.exp: Use standard_testfile.
* gdb.python/py-frame.exp: Use standard_testfile.
* gdb.python/py-inferior.exp: Use standard_testfile.
* gdb.python/py-infthread.exp: Use standard_testfile.
* gdb.python/py-mi.exp: Use standard_testfile.
* gdb.python/py-objfile-script.exp: Use standard_testfile,
build_executable.
* gdb.python/py-objfile.exp: Use standard_testfile.
* gdb.python/py-pp-maint.exp: Use standard_testfile,
prepare_for_testing.
* gdb.python/py-prettyprint.exp: Use standard_testfile.
* gdb.python/py-progspace.exp: Use standard_testfile,
build_executable.
* gdb.python/py-prompt.exp: Use standard_testfile,
build_executable.
* gdb.python/py-section-script.exp: Use standard_testfile,
build_executable.
* gdb.python/py-shared.exp: Use standard_testfile,
standard_output_file, clean_restart.
* gdb.python/py-symbol.exp: Use standard_output_file,
prepare_for_testing.
* gdb.python/py-symtab.exp: Use standard_output_file,
prepare_for_testing
* gdb.python/py-template.exp: Use standard_testfile.
* gdb.python/py-type.exp: Use standard_testfile.
* gdb.python/py-value-cc.exp: Use standard_testfile.
* gdb.python/py-value.exp: Use standard_testfile.
* gdb.python/python.exp: Use standard_testfile, build_executable.
+
+ * gdb.python/lib-types.exp: Use standard_testfile,
+ prepare_for_testing.
+ * gdb.python/py-block.exp: Use standard_testfile.
+ * gdb.python/py-breakpoint.exp: Use standard_testfile.
+ * gdb.python/py-events.exp: Use standard_testfile,
+ standard_output_file.
+ * gdb.python/py-evsignal.exp: Use standard_testfile.
+ * gdb.python/py-evethreads.exp: Use standard_testfile.
+ * gdb.python/py-explore-cc.exp: Use standard_testfile.
+ * gdb.python/py-explore.exp: Use standard_testfile.
+ * gdb.python/py-finish-breakpoint.exp: Use standard_testfile,
+ standard_output_file.
+ * gdb.python/py-finish-breakpoint2.exp: Use standard_testfile,
+ prepare_for_testing.
+ * gdb.python/py-frame-inline.exp: Use standard_testfile.
+ * gdb.python/py-frame.exp: Use standard_testfile.
+ * gdb.python/py-inferior.exp: Use standard_testfile.
+ * gdb.python/py-infthread.exp: Use standard_testfile.
+ * gdb.python/py-mi.exp: Use standard_testfile.
+ * gdb.python/py-objfile-script.exp: Use standard_testfile,
+ build_executable.
+ * gdb.python/py-objfile.exp: Use standard_testfile.
+ * gdb.python/py-pp-maint.exp: Use standard_testfile,
+ prepare_for_testing.
+ * gdb.python/py-prettyprint.exp: Use standard_testfile.
+ * gdb.python/py-progspace.exp: Use standard_testfile,
+ build_executable.
+ * gdb.python/py-prompt.exp: Use standard_testfile,
+ build_executable.
+ * gdb.python/py-section-script.exp: Use standard_testfile,
+ build_executable.
+ * gdb.python/py-shared.exp: Use standard_testfile,
+ standard_output_file, clean_restart.
+ * gdb.python/py-symbol.exp: Use standard_output_file,
+ prepare_for_testing.
+ * gdb.python/py-symtab.exp: Use standard_output_file,
+ prepare_for_testing
+ * gdb.python/py-template.exp: Use standard_testfile.
+ * gdb.python/py-type.exp: Use standard_testfile.
+ * gdb.python/py-value-cc.exp: Use standard_testfile.
+ * gdb.python/py-value.exp: Use standard_testfile.
+ * gdb.python/python.exp: Use standard_testfile, build_executable.
+
* gdb.objc/basicclass.exp: Use standard_testfile.
load_lib gdb-python.exp
-set testfile "lib-types"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
- untested "Couldn't compile ${srcfile}"
+standard_testfile .cc
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
return -1
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
load_lib gdb-python.exp
-set testfile "py-block"
-set srcfile ${testfile}.c
+standard_testfile
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
load_lib gdb-python.exp
-set testfile "py-breakpoint"
-set srcfile ${testfile}.c
+standard_testfile
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
set libfile "py-events-shlib"
set libsrc $srcdir/$subdir/$libfile.c
-set lib_sl $objdir/$subdir/$libfile.so
+set lib_sl [standard_output_file $libfile.so]
set lib_opts debug
-set testfile "py-events"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
set exec_opts [list debug shlib=$lib_sl]
set pyfile ${srcdir}/${subdir}/${testfile}.py
load_lib gdb-python.exp
-set testfile "py-evsignal"
-set srcfile py-evthreads.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile py-evthreads.c
set pyfile ${srcdir}/${subdir}/py-events.py
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
load_lib gdb-python.exp
-set testfile "py-evthreads"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
set pyfile ${srcdir}/${subdir}/py-events.py
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
if { [skip_cplus_tests] } { continue }
-set testfile "py-explore"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile py-explore.cc
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
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/>.
-set testfile "py-explore"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
set libfile "py-events-shlib"
set libsrc $srcdir/$subdir/$libfile.c
-set lib_sl $objdir/$subdir/$libfile-nodebug.so
+set lib_sl [standard_output_file $libfile-nodebug.so]
set lib_opts ""
-set testfile "py-finish-breakpoint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
set exec_opts [list debug shlib=$lib_sl]
if [get_compiler_info] {
load_lib gdb-python.exp
-set testfile "py-finish-breakpoint2"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
set pyfile ${srcdir}/${subdir}/${testfile}.py
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
- untested "Couldn't compile ${srcfile}"
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
load_lib gdb-python.exp
-set testfile "py-frame-inline"
-set srcfile ${testfile}.c
+standard_testfile
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
load_lib gdb-python.exp
-set testfile "py-frame"
-set srcfile ${testfile}.c
+standard_testfile
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
load_lib gdb-python.exp
-set testfile "py-inferior"
-set srcfile ${testfile}.c
+standard_testfile
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
gdb_test "inferior 3" ".*" "Switch to third inferior"
gdb_test "py print gdb.selected_inferior().num" "3" "Third inferior selected"
gdb_test "inferior 1" ".*" "Switch to first inferior"
-gdb_test_no_output "remove-inferiors 3" "Remove second inferior"
\ No newline at end of file
+gdb_test_no_output "remove-inferiors 3" "Remove second inferior"
load_lib gdb-python.exp
-set testfile "py-infthread"
-set srcfile ${testfile}.c
+standard_testfile
+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
}
continue
}
-set testfile "py-mi"
-set srcfile py-prettyprint.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile py-prettyprint.c
set pyfile py-prettyprint.py
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DMI}] != "" } {
untested ${testfile}.exp
# This file is part of the GDB testsuite. It tests automagic loading of
# -gdb.py scripts.
-set testfile "py-objfile-script"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "Couldn't compile ${srcfile}"
+standard_testfile
+
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
return -1
}
load_lib gdb-python.exp
-set testfile "py-objfile"
-set srcfile ${testfile}.c
+standard_testfile
if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
return -1
load_lib gdb-python.exp
-set testfile "py-pp-maint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+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 }
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug"] != "" } {
- untested "Couldn't compile ${srcfile}"
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
return -1
}
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
if ![runto_main ] then {
fail "Can't run to main"
load_lib gdb-python.exp
-set testfile "py-prettyprint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# Start with a fresh gdb.
gdb_exit
# This file is part of the GDB testsuite. It tests the program space
# support in Python.
-set testfile "py-progspace"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "Couldn't compile ${srcfile}"
+standard_testfile
+
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
return -1
}
# This file is part of the GDB testsuite. It tests the mechanism
# for defining the prompt in Python.
-set testfile "py-prompt"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# We need to use TCL's exec to get the pid.
if [is_remote target] then {
if { [skip_python_tests] } { continue }
gdb_exit
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested py-prompt.exp
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
return -1
}
return
}
-set testfile "py-section-script"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "Couldn't compile ${srcfile}"
+standard_testfile
+
+if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
return -1
}
return 0
}
-set testfile "py-shared"
-set srcfile ${testfile}.c
+standard_testfile
+
set libfile "py-shared-sl"
set libsrc ${libfile}.c
-set library ${objdir}/${subdir}/${libfile}.sl
-set binfile ${objdir}/${subdir}/${testfile}
+set library [standard_output_file ${libfile}.sl]
if { [gdb_compile_shlib ${srcdir}/${subdir}/${libsrc} ${library} "debug"] != "" } {
untested "Could not compile shared library."
}
# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $testfile
gdb_load_shlibs ${library}
# Skip all tests if Python scripting is not enabled.
load_lib gdb-python.exp
-set testfile "py-symbol"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "Couldn't compile ${srcfile}"
+standard_testfile
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
return -1
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
load_lib gdb-python.exp
-set testfile "py-symbol"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "Couldn't compile ${srcfile}"
+standard_testfile py-symbol.c
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
return -1
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
if { [skip_cplus_tests] } { continue }
-set testfile "py-template"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
{debug c++}] != "" } {
untested "Couldn't compile ${srcfile}"
load_lib gdb-python.exp
-set testfile "py-type"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
if [get_compiler_info c++] {
return -1;
if { [skip_cplus_tests] } { continue }
-set testfile "py-value"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile py-value.cc
if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1
load_lib gdb-python.exp
-set testfile "py-value"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# Build inferior to language specification.
proc build_inferior {exefile lang} {
load_lib gdb-python.exp
-set testfile "python"
-set srcfile ${testfile}.c
-set srcfile1 ${testfile}-1.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1}" \
- ${binfile} executable {debug}] != "" } {
- untested "Could not compile $binfile."
+standard_testfile python.c python-1.c
+
+if {[build_executable $testfile.exp $testfile \
+ [list $srcfile $srcfile2] debug] == -1} {
return -1
}