This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: clean up gdb.python
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 22 Jun 2012 11:59:12 -0600
- Subject: FYI: clean up gdb.python
I'm checking this in.
This cleans up the gdb.python tests. Now they use standard_testfile and
standard_output_file as appropriate; and I also changed them to use
prepare_for_testing or build_executable when appropriate.
After this patch, gdb.python is objdir-free as well.
Regtested on x86-64 Fedora 16.
Tom
2012-06-22 Tom Tromey <tromey@redhat.com>
* 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.
Index: gdb.python/lib-types.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/lib-types.exp,v
retrieving revision 1.7
diff -u -r1.7 lib-types.exp
--- gdb.python/lib-types.exp 16 Jan 2012 16:21:52 -0000 1.7
+++ gdb.python/lib-types.exp 22 Jun 2012 17:54:16 -0000
@@ -18,20 +18,12 @@
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 }
Index: gdb.python/py-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-block.exp,v
retrieving revision 1.10
diff -u -r1.10 py-block.exp
--- gdb.python/py-block.exp 16 Jan 2012 16:21:52 -0000 1.10
+++ gdb.python/py-block.exp 22 Jun 2012 17:54:16 -0000
@@ -18,8 +18,8 @@
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
}
Index: gdb.python/py-breakpoint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-breakpoint.exp,v
retrieving revision 1.14
diff -u -r1.14 py-breakpoint.exp
--- gdb.python/py-breakpoint.exp 16 Jan 2012 16:21:52 -0000 1.14
+++ gdb.python/py-breakpoint.exp 22 Jun 2012 17:54:16 -0000
@@ -18,8 +18,8 @@
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
}
Index: gdb.python/py-events.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-events.exp,v
retrieving revision 1.11
diff -u -r1.11 py-events.exp
--- gdb.python/py-events.exp 21 Jun 2012 20:46:24 -0000 1.11
+++ gdb.python/py-events.exp 22 Jun 2012 17:54:16 -0000
@@ -21,12 +21,10 @@
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
Index: gdb.python/py-evsignal.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-evsignal.exp,v
retrieving revision 1.3
diff -u -r1.3 py-evsignal.exp
--- gdb.python/py-evsignal.exp 16 Jan 2012 16:21:52 -0000 1.3
+++ gdb.python/py-evsignal.exp 22 Jun 2012 17:54:16 -0000
@@ -21,9 +21,7 @@
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}] != "" } {
Index: gdb.python/py-evthreads.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-evthreads.exp,v
retrieving revision 1.8
diff -u -r1.8 py-evthreads.exp
--- gdb.python/py-evthreads.exp 16 Jan 2012 16:21:52 -0000 1.8
+++ gdb.python/py-evthreads.exp 22 Jun 2012 17:54:16 -0000
@@ -26,9 +26,7 @@
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}] != "" } {
Index: gdb.python/py-explore-cc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-explore-cc.exp,v
retrieving revision 1.1
diff -u -r1.1 py-explore-cc.exp
--- gdb.python/py-explore-cc.exp 11 Apr 2012 05:50:44 -0000 1.1
+++ gdb.python/py-explore-cc.exp 22 Jun 2012 17:54:16 -0000
@@ -18,9 +18,7 @@
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
Index: gdb.python/py-explore.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-explore.exp,v
retrieving revision 1.1
diff -u -r1.1 py-explore.exp
--- gdb.python/py-explore.exp 11 Apr 2012 05:50:44 -0000 1.1
+++ gdb.python/py-explore.exp 22 Jun 2012 17:54:16 -0000
@@ -13,9 +13,8 @@
# 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
}
Index: gdb.python/py-finish-breakpoint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-finish-breakpoint.exp,v
retrieving revision 1.6
diff -u -r1.6 py-finish-breakpoint.exp
--- gdb.python/py-finish-breakpoint.exp 21 Jun 2012 20:46:24 -0000 1.6
+++ gdb.python/py-finish-breakpoint.exp 22 Jun 2012 17:54:16 -0000
@@ -25,12 +25,10 @@
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] {
Index: gdb.python/py-finish-breakpoint2.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp,v
retrieving revision 1.4
diff -u -r1.4 py-finish-breakpoint2.exp
--- gdb.python/py-finish-breakpoint2.exp 16 Jan 2012 16:21:52 -0000 1.4
+++ gdb.python/py-finish-breakpoint2.exp 22 Jun 2012 17:54:16 -0000
@@ -18,22 +18,13 @@
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 }
Index: gdb.python/py-frame-inline.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-frame-inline.exp,v
retrieving revision 1.2
diff -u -r1.2 py-frame-inline.exp
--- gdb.python/py-frame-inline.exp 4 Jan 2012 08:27:49 -0000 1.2
+++ gdb.python/py-frame-inline.exp 22 Jun 2012 17:54:16 -0000
@@ -15,8 +15,8 @@
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
}
Index: gdb.python/py-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-frame.exp,v
retrieving revision 1.12
diff -u -r1.12 py-frame.exp
--- gdb.python/py-frame.exp 16 Jan 2012 16:21:52 -0000 1.12
+++ gdb.python/py-frame.exp 22 Jun 2012 17:54:16 -0000
@@ -18,8 +18,8 @@
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
}
Index: gdb.python/py-inferior.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-inferior.exp,v
retrieving revision 1.11
diff -u -r1.11 py-inferior.exp
--- gdb.python/py-inferior.exp 16 Jan 2012 16:21:52 -0000 1.11
+++ gdb.python/py-inferior.exp 22 Jun 2012 17:54:16 -0000
@@ -18,8 +18,8 @@
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
}
@@ -216,4 +216,4 @@
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"
Index: gdb.python/py-infthread.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-infthread.exp,v
retrieving revision 1.8
diff -u -r1.8 py-infthread.exp
--- gdb.python/py-infthread.exp 8 Mar 2012 22:19:48 -0000 1.8
+++ gdb.python/py-infthread.exp 22 Jun 2012 17:54:16 -0000
@@ -18,8 +18,8 @@
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
}
Index: gdb.python/py-mi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-mi.exp,v
retrieving revision 1.15
diff -u -r1.15 py-mi.exp
--- gdb.python/py-mi.exp 4 Jan 2012 08:27:49 -0000 1.15
+++ gdb.python/py-mi.exp 22 Jun 2012 17:54:16 -0000
@@ -24,9 +24,7 @@
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
Index: gdb.python/py-objfile-script.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-objfile-script.exp,v
retrieving revision 1.6
diff -u -r1.6 py-objfile-script.exp
--- gdb.python/py-objfile-script.exp 17 Apr 2012 15:54:35 -0000 1.6
+++ gdb.python/py-objfile-script.exp 22 Jun 2012 17:54:16 -0000
@@ -16,11 +16,9 @@
# 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
}
Index: gdb.python/py-objfile.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-objfile.exp,v
retrieving revision 1.3
diff -u -r1.3 py-objfile.exp
--- gdb.python/py-objfile.exp 16 Jan 2012 16:21:52 -0000 1.3
+++ gdb.python/py-objfile.exp 22 Jun 2012 17:54:16 -0000
@@ -18,8 +18,7 @@
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
Index: gdb.python/py-pp-maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-pp-maint.exp,v
retrieving revision 1.7
diff -u -r1.7 py-pp-maint.exp
--- gdb.python/py-pp-maint.exp 16 Jan 2012 19:44:16 -0000 1.7
+++ gdb.python/py-pp-maint.exp 22 Jun 2012 17:54:16 -0000
@@ -23,24 +23,14 @@
load_lib gdb-python.exp
-set testfile "py-pp-maint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
+standard_testfile
-# 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"
Index: gdb.python/py-prettyprint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-prettyprint.exp,v
retrieving revision 1.25
diff -u -r1.25 py-prettyprint.exp
--- gdb.python/py-prettyprint.exp 16 Jan 2012 16:21:52 -0000 1.25
+++ gdb.python/py-prettyprint.exp 22 Jun 2012 17:54:16 -0000
@@ -18,9 +18,7 @@
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
Index: gdb.python/py-progspace.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-progspace.exp,v
retrieving revision 1.4
diff -u -r1.4 py-progspace.exp
--- gdb.python/py-progspace.exp 16 Jan 2012 16:21:52 -0000 1.4
+++ gdb.python/py-progspace.exp 22 Jun 2012 17:54:16 -0000
@@ -16,11 +16,9 @@
# 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
}
Index: gdb.python/py-prompt.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-prompt.exp,v
retrieving revision 1.4
diff -u -r1.4 py-prompt.exp
--- gdb.python/py-prompt.exp 19 May 2012 01:05:38 -0000 1.4
+++ gdb.python/py-prompt.exp 22 Jun 2012 17:54:16 -0000
@@ -16,9 +16,7 @@
# 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 {
@@ -38,8 +36,7 @@
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
}
Index: gdb.python/py-section-script.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-section-script.exp,v
retrieving revision 1.9
diff -u -r1.9 py-section-script.exp
--- gdb.python/py-section-script.exp 17 Apr 2012 15:54:35 -0000 1.9
+++ gdb.python/py-section-script.exp 22 Jun 2012 17:54:16 -0000
@@ -29,11 +29,9 @@
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
}
Index: gdb.python/py-shared.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-shared.exp,v
retrieving revision 1.6
diff -u -r1.6 py-shared.exp
--- gdb.python/py-shared.exp 4 Jan 2012 08:27:49 -0000 1.6
+++ gdb.python/py-shared.exp 22 Jun 2012 17:54:16 -0000
@@ -21,12 +21,11 @@
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."
@@ -41,10 +40,7 @@
}
# 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.
Index: gdb.python/py-symbol.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-symbol.exp,v
retrieving revision 1.14
diff -u -r1.14 py-symbol.exp
--- gdb.python/py-symbol.exp 8 Feb 2012 19:58:25 -0000 1.14
+++ gdb.python/py-symbol.exp 22 Jun 2012 17:54:16 -0000
@@ -18,20 +18,12 @@
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 }
Index: gdb.python/py-symtab.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-symtab.exp,v
retrieving revision 1.9
diff -u -r1.9 py-symtab.exp
--- gdb.python/py-symtab.exp 3 May 2012 07:07:26 -0000 1.9
+++ gdb.python/py-symtab.exp 22 Jun 2012 17:54:16 -0000
@@ -18,20 +18,12 @@
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 }
Index: gdb.python/py-template.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-template.exp,v
retrieving revision 1.11
diff -u -r1.11 py-template.exp
--- gdb.python/py-template.exp 16 Jan 2012 16:21:52 -0000 1.11
+++ gdb.python/py-template.exp 22 Jun 2012 17:54:16 -0000
@@ -18,9 +18,7 @@
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}"
Index: gdb.python/py-type.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-type.exp,v
retrieving revision 1.23
diff -u -r1.23 py-type.exp
--- gdb.python/py-type.exp 21 Jun 2012 20:46:24 -0000 1.23
+++ gdb.python/py-type.exp 22 Jun 2012 17:54:16 -0000
@@ -18,9 +18,7 @@
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;
Index: gdb.python/py-value-cc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value-cc.exp,v
retrieving revision 1.1
diff -u -r1.1 py-value-cc.exp
--- gdb.python/py-value-cc.exp 22 Mar 2012 08:10:44 -0000 1.1
+++ gdb.python/py-value-cc.exp 22 Jun 2012 17:54:16 -0000
@@ -18,9 +18,7 @@
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
Index: gdb.python/py-value.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value.exp,v
retrieving revision 1.27
diff -u -r1.27 py-value.exp
--- gdb.python/py-value.exp 16 Jan 2012 16:21:52 -0000 1.27
+++ gdb.python/py-value.exp 22 Jun 2012 17:54:16 -0000
@@ -18,9 +18,7 @@
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} {
Index: gdb.python/python.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/python.exp,v
retrieving revision 1.33
diff -u -r1.33 python.exp
--- gdb.python/python.exp 13 May 2012 11:33:44 -0000 1.33
+++ gdb.python/python.exp 22 Jun 2012 17:54:16 -0000
@@ -18,14 +18,10 @@
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
}