This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 5/7] test suite update - gdb.base/[nopqr]


Files gdb.base/[nopqr]*.exp.
See message #0 for details.

	* nextoverexit.exp, nextoverexit.exp, nodebug.exp, nofield.exp,
	nostdlib.exp, opaque.exp, overlays.exp, pc-fp.exp, pending.exp,
	permissions.exp, pie-execl.exp, pointers.exp, pr11022.exp,
	print-file-var.exp, printcmds.exp, prologue.exp, psymtab.exp,
	ptr-typedef.exp, ptype.exp, randomize.exp, readline-ask.exp,
	recpar.exp, recurse.exp, relativedebug.exp, relocate.exp,
	remote.exp, reread.exp, return-nodebug.exp, return2.exp: Use
	standard_testfile, standard_output_file, prepare_for_testing,
	clean_restart.
---
 gdb/testsuite/gdb.base/nextoverexit.exp   |  5 +----
 gdb/testsuite/gdb.base/nodebug.exp        | 11 +++-------
 gdb/testsuite/gdb.base/nofield.exp        | 10 +++------
 gdb/testsuite/gdb.base/nostdlib.exp       |  7 ++-----
 gdb/testsuite/gdb.base/opaque.exp         | 34 ++++++-------------------------
 gdb/testsuite/gdb.base/overlays.exp       | 33 ++++--------------------------
 gdb/testsuite/gdb.base/pc-fp.exp          | 15 ++++----------
 gdb/testsuite/gdb.base/pending.exp        |  6 ++----
 gdb/testsuite/gdb.base/permissions.exp    | 15 +++++++-------
 gdb/testsuite/gdb.base/pie-execl.exp      |  7 +++----
 gdb/testsuite/gdb.base/pointers.exp       |  9 ++------
 gdb/testsuite/gdb.base/pr11022.exp        | 10 +++------
 gdb/testsuite/gdb.base/print-file-var.exp |  6 +++---
 gdb/testsuite/gdb.base/printcmds.exp      |  5 ++---
 gdb/testsuite/gdb.base/prologue.exp       |  9 ++------
 gdb/testsuite/gdb.base/psymtab.exp        | 27 ++++++------------------
 gdb/testsuite/gdb.base/ptr-typedef.exp    | 10 +++------
 gdb/testsuite/gdb.base/ptype.exp          | 26 +++++------------------
 gdb/testsuite/gdb.base/randomize.exp      | 16 ++++-----------
 gdb/testsuite/gdb.base/readline-ask.exp   |  7 ++-----
 gdb/testsuite/gdb.base/recpar.exp         |  4 ++--
 gdb/testsuite/gdb.base/recurse.exp        | 18 +++++-----------
 gdb/testsuite/gdb.base/relativedebug.exp  | 10 +++------
 gdb/testsuite/gdb.base/relocate.exp       |  5 ++---
 gdb/testsuite/gdb.base/remote.exp         |  4 +---
 gdb/testsuite/gdb.base/reread.exp         |  6 +++---
 gdb/testsuite/gdb.base/return-nodebug.exp | 24 +++++-----------------
 gdb/testsuite/gdb.base/return2.exp        | 10 +++------
 28 files changed, 91 insertions(+), 258 deletions(-)

diff --git a/gdb/testsuite/gdb.base/nextoverexit.exp b/gdb/testsuite/gdb.base/nextoverexit.exp
index 4f4529f..6cf6f90 100644
--- a/gdb/testsuite/gdb.base/nextoverexit.exp
+++ b/gdb/testsuite/gdb.base/nextoverexit.exp
@@ -12,10 +12,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/>.
 
-set testfile "nextoverexit"
-set executable $testfile
-set srcfile $testfile.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile
 
 if {[prepare_for_testing $testfile.exp $testfile $testfile.c]} {
     return -1
diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp
index e451b7b..2c991dc 100644
--- a/gdb/testsuite/gdb.base/nodebug.exp
+++ b/gdb/testsuite/gdb.base/nodebug.exp
@@ -16,9 +16,7 @@
 # Test that things still (sort of) work when compiled without -g.
 
 
-set testfile nodebug
-set srcfile $srcdir/$subdir/$testfile.c
-set binfile $objdir/$subdir/$testfile
+standard_testfile .c
 
 if [get_compiler_info] {
     return -1
@@ -32,17 +30,14 @@ if [test_compiler_info "xlc-*"] {
     set exec_opts ""
 }
 
-if  { [gdb_compile $srcfile $binfile executable $exec_opts] != "" } {
+if  { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != "" } {
     untested "Couldn't compile $srcfile."
     return -1
 }
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+clean_restart $binfile
 
 if [runto inner] then {
     
diff --git a/gdb/testsuite/gdb.base/nofield.exp b/gdb/testsuite/gdb.base/nofield.exp
index 9b8ef06..bdaf6ca 100644
--- a/gdb/testsuite/gdb.base/nofield.exp
+++ b/gdb/testsuite/gdb.base/nofield.exp
@@ -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 "nofield"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     untested "Couldn't compile ${srcfile}"
     return -1
@@ -24,10 +23,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
 set eol "\[\r\n\]+"
 set sp "\[ \t\]*"
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 gdb_test "ptype struct not_empty" \
          "type = struct not_empty {$eol${sp}void \\*e;$eol${sp}void \\*u;$eol}" \
diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp
index 177023c..e139f3e 100644
--- a/gdb/testsuite/gdb.base/nostdlib.exp
+++ b/gdb/testsuite/gdb.base/nostdlib.exp
@@ -13,10 +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/>.
 
-set testfile "nostdlib"
-set srcfile ${testfile}.c
-set executable ${testfile}
-set binfile ${objdir}/${subdir}/${executable}
+standard_testfile .c
 
 # If we're using a stub, breakpoints at the entry point will not trigger.
 # See also the comment in break-entry.exp.
@@ -48,7 +45,7 @@ if {$err != ""} {
     return -1
 }
 
-clean_restart $executable
+clean_restart $binfile
 
 gdb_breakpoint "*marker"
 gdb_breakpoint "*_start"
diff --git a/gdb/testsuite/gdb.base/opaque.exp b/gdb/testsuite/gdb.base/opaque.exp
index 3628e5c..94f0412 100644
--- a/gdb/testsuite/gdb.base/opaque.exp
+++ b/gdb/testsuite/gdb.base/opaque.exp
@@ -16,41 +16,19 @@
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
 
-set testfile "opaque"
-set binfile ${objdir}/${subdir}/opaque
-
-#if  { [gdb_compile "${srcdir}/${subdir}/opaque0.c ${srcdir}/${subdir}/opaque1.c" "${binfile}" executable {debug}] != "" } {
-#     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-#}
-
-if  { [gdb_compile "${srcdir}/${subdir}/opaque0.c" "${binfile}0.o" object {debug}] != "" } {
-     untested opaque.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/opaque1.c" "${binfile}1.o" object {debug}] != "" } {
-     untested opaque.exp
-     return -1
-}
-
-if  { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
-     untested opaque.exp
-     return -1
-}
-
-
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
 if [get_compiler_info] {
     return -1
 }
 
-# Start with a fresh gdb.
+standard_testfile opaque0.c opaque1.c
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+if {[prepare_for_testing $testfile.exp $testfile \
+	 [list $srcfile $srcfile2] debug]} {
+    untested $testfile.exp
+    return -1
+}
 
 #
 # Test basic opaque structure handling (statically).
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
index d294378..13d2463 100644
--- a/gdb/testsuite/gdb.base/overlays.exp
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -39,36 +39,11 @@ if [istarget "*-*-linux*"] then {
     return 
 }
 
-set testfile "overlays"
-set binfile ${objdir}/${subdir}/${testfile}
-set srcfile ${testfile}.c
+standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c
 
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/foo.c" foo.o object {debug} ] != ""} then {
-     untested overlays.exp
-     return -1
-}
-
-if {[gdb_compile "${srcdir}/${subdir}/bar.c" bar.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/baz.c" baz.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/grbx.c" grbx.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if  {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } {
+if {[build_executable $testfile.exp $testfile \
+	 [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \
+	 {debug ldscript=-Wl,-T$linker_script}] == -1} {
      untested overlays.exp
      return -1
 }
diff --git a/gdb/testsuite/gdb.base/pc-fp.exp b/gdb/testsuite/gdb.base/pc-fp.exp
index edf1d66..7bf2f37 100644
--- a/gdb/testsuite/gdb.base/pc-fp.exp
+++ b/gdb/testsuite/gdb.base/pc-fp.exp
@@ -24,24 +24,17 @@
 # test running programs
 #
 
-set testfile "pc-fp"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-    untested pc-fp.exp
+if [get_compiler_info] {
     return -1
 }
 
-if [get_compiler_info] {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug nowarnings}]} {
+    untested $testfile.exp
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
     continue
diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index 1ab896a..1d621de 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -23,12 +23,10 @@ if {[skip_shlib_tests]} {
     return 0
 }
 
-set testfile "pending"
+standard_testfile .c
 set libfile "pendshr"
-set srcfile $testfile.c
 set libsrc  $srcdir/$subdir/$libfile.c
-set binfile $objdir/$subdir/$testfile
-set lib_sl  $objdir/$subdir/$libfile.sl
+set lib_sl  [standard_output_file $libfile.sl]
 
 set lib_opts  debug
 set exec_opts [list debug shlib=$lib_sl]
diff --git a/gdb/testsuite/gdb.base/permissions.exp b/gdb/testsuite/gdb.base/permissions.exp
index ed0e7e7..00d71d4 100644
--- a/gdb/testsuite/gdb.base/permissions.exp
+++ b/gdb/testsuite/gdb.base/permissions.exp
@@ -18,14 +18,13 @@
 # The permissions flags are only fully functional with stubs or targets
 # that can run asynchronously.
 
-set testfile permission
-set srcfile start.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-     untested permissions.exp
-     return -1
-    }
+standard_testfile start.c
+
+if {[build_executable $testfile.exp $testfile \
+	 $srcfile {debug nowarnings}] == -1} {
+    untested $testfile.exp
+    return -1
+}
 
 if [get_compiler_info] {
     return -1
diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp
index f8e5e33..2bdccc1 100644
--- a/gdb/testsuite/gdb.base/pie-execl.exp
+++ b/gdb/testsuite/gdb.base/pie-execl.exp
@@ -26,12 +26,11 @@ if [is_remote target] {
     continue
 }
 
-set testfile "pie-execl"
-set srcfile ${testfile}.c
+standard_testfile .c
 set executable1 ${testfile}1
 set executable2 ${testfile}2
-set binfile1 ${objdir}/${subdir}/${executable1}
-set binfile2 ${objdir}/${subdir}/${executable2}
+set binfile1 ${binfile}1
+set binfile2 ${binfile}2
 set binfile2_test_msg OBJDIR/${subdir}/${executable2}
 
 # Use conditional compilation according to `BIN' as GDB remembers the source
diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index 6b9c52d..192b139 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -25,9 +25,7 @@
 # test running programs
 #
 
-set testfile "pointers"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
      untested pointers.exp
@@ -38,10 +36,7 @@ if [get_compiler_info] {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 
 #
diff --git a/gdb/testsuite/gdb.base/pr11022.exp b/gdb/testsuite/gdb.base/pr11022.exp
index 3465b74..86d7f04 100644
--- a/gdb/testsuite/gdb.base/pr11022.exp
+++ b/gdb/testsuite/gdb.base/pr11022.exp
@@ -17,9 +17,8 @@ if {[skip_hw_watchpoint_tests]} {
     return 0
 }
 
-set testfile "pr11022"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested pr11022.exp
      return -1
@@ -27,10 +26,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     fail "Can't run to main"
diff --git a/gdb/testsuite/gdb.base/print-file-var.exp b/gdb/testsuite/gdb.base/print-file-var.exp
index fce4571..41f00f6 100644
--- a/gdb/testsuite/gdb.base/print-file-var.exp
+++ b/gdb/testsuite/gdb.base/print-file-var.exp
@@ -22,8 +22,8 @@ set executable print-file-var-main
 set lib1 "print-file-var-lib1"
 set lib2 "print-file-var-lib2"
 
-set libobj1 "${objdir}/${subdir}/${lib1}.so"
-set libobj2 "${objdir}/${subdir}/${lib2}.so"
+set libobj1 [standard_output_file ${lib1}.so]
+set libobj2 [standard_output_file ${lib2}.so]
 
 set lib_opts { debug additional_flags=-fPIC }
 
@@ -38,7 +38,7 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${lib2}.c \
     return -1
 }
 if { [gdb_compile "${srcdir}/${subdir}/${executable}.c" \
-                  "${objdir}/${subdir}/${executable}" \
+                  [standard_output_file ${executable}] \
                   executable \
                   [list debug shlib=${libobj1} shlib=${libobj2}]]
      != ""} {
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 316461a..0597ab0 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -20,9 +20,8 @@
 
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
-set testfile "printcmds"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested printcmds.exp
      return -1
diff --git a/gdb/testsuite/gdb.base/prologue.exp b/gdb/testsuite/gdb.base/prologue.exp
index 409c80e..ebc1adf 100644
--- a/gdb/testsuite/gdb.base/prologue.exp
+++ b/gdb/testsuite/gdb.base/prologue.exp
@@ -16,19 +16,14 @@
 
 if { [skip_cplus_tests] } { continue }
 
-set testfile "prologue"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested prologue.exp
      return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
diff --git a/gdb/testsuite/gdb.base/psymtab.exp b/gdb/testsuite/gdb.base/psymtab.exp
index 9c96536..854455e 100644
--- a/gdb/testsuite/gdb.base/psymtab.exp
+++ b/gdb/testsuite/gdb.base/psymtab.exp
@@ -26,23 +26,7 @@
 
 if { [skip_cplus_tests] } { continue }
 
-set testfile "psymtab"
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${testfile}1.c" "${testfile}1.o" object {debug}] != "" } {
-     untested psymtab.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${testfile}2.c" "${testfile}2.o" object {debug}] != "" } {
-     untested psymtab.exp
-     return -1
-}
-
-if  { [gdb_compile "${testfile}1.o ${testfile}2.o" ${binfile} executable {debug}] != "" } {
-     untested psymtab.exp
-     return -1
-}
+standard_testfile psymtab1.c psymtab2.c
 
 # Create and source the file that provides information about the compiler
 # used to compile the test case.
@@ -50,10 +34,11 @@ if [get_compiler_info] {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+if {[prepare_for_testing $testfile.exp $testfile \
+	 [list $srcfile $srcfile2] debug]} {
+    untested $testfile.exp
+    return -1
+}
 
 # Disable the prompt for whether to set pending breakpoints.
 # We don't want a breakpoint, we just want to verify the symbol
diff --git a/gdb/testsuite/gdb.base/ptr-typedef.exp b/gdb/testsuite/gdb.base/ptr-typedef.exp
index f0ef97a..d0d2628 100644
--- a/gdb/testsuite/gdb.base/ptr-typedef.exp
+++ b/gdb/testsuite/gdb.base/ptr-typedef.exp
@@ -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 ptr-typedef
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     untested "Couldn't compile test program"
     return -1
@@ -23,10 +22,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 # Get things started.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if ![runto marker1] {
     untested "Couldn't run to marker1"
diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
index bb186d3..fdc04fe 100644
--- a/gdb/testsuite/gdb.base/ptype.exp
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -19,22 +19,11 @@
 # test running programs
 #
 
-set testfile "ptype"
-set srcfile0 ${testfile}.c
-set srcfile1 ${testfile}1.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile0}" "${binfile}0.o" object {debug}] != "" } {
-     untested ptype.exp
-     return -1
-}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug}] != "" } {
-     untested ptype.exp
-     return -1
-}
-if  { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug}] != "" } {
-     untested ptype.exp
-     return -1
+standard_testfile .c ptype1.c
+
+if {[prepare_for_testing ${testfile}.exp ${testfile} \
+	 [list $srcfile $srcfile2] {debug nowarnings}]} {
+    return -1
 }
 
 # Create and source the file that provides information about the compiler
@@ -43,11 +32,6 @@ if [get_compiler_info] {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 # Test ptype of unnamed enumeration members before any action causes
 # the partial symbol table to be expanded to full symbols.  This fails
 # with stabs compilers which fail to use a nameless stab (such as
diff --git a/gdb/testsuite/gdb.base/randomize.exp b/gdb/testsuite/gdb.base/randomize.exp
index e84b493..7859906 100644
--- a/gdb/testsuite/gdb.base/randomize.exp
+++ b/gdb/testsuite/gdb.base/randomize.exp
@@ -13,21 +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/>.
 
-set testfile randomize
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested "Couldn't compile test program"
+standard_testfile
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+    untested $testfile.exp
     return -1
 }
 
-# Get things started.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 proc address_get { testname } {
     global gdb_prompt
 
diff --git a/gdb/testsuite/gdb.base/readline-ask.exp b/gdb/testsuite/gdb.base/readline-ask.exp
index b71bd0a..33f3b25 100644
--- a/gdb/testsuite/gdb.base/readline-ask.exp
+++ b/gdb/testsuite/gdb.base/readline-ask.exp
@@ -13,10 +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/>.
 
-set testfile readline-ask
-set executable ${testfile}.x
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${executable}
+standard_testfile .c
 set inputrc ${srcdir}/${subdir}/${testfile}.inputrc
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
@@ -26,7 +23,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}]
 
 # INPUTRC gets reset for the next testfile.
 setenv INPUTRC $inputrc
-clean_restart ${executable}
+clean_restart ${binfile}
 
 gdb_test_no_output "set width 50"
 gdb_test_no_output "set height 3"
diff --git a/gdb/testsuite/gdb.base/recpar.exp b/gdb/testsuite/gdb.base/recpar.exp
index fabd131..699d8a6 100644
--- a/gdb/testsuite/gdb.base/recpar.exp
+++ b/gdb/testsuite/gdb.base/recpar.exp
@@ -13,8 +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 recpar
-set srcfile ${testfile}.c
+standard_testfile .c
+
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
     return -1
 }
diff --git a/gdb/testsuite/gdb.base/recurse.exp b/gdb/testsuite/gdb.base/recurse.exp
index da635bf..7155808 100644
--- a/gdb/testsuite/gdb.base/recurse.exp
+++ b/gdb/testsuite/gdb.base/recurse.exp
@@ -16,20 +16,12 @@
 # This file was written by Jeff Law. (law@cs.utah.edu)
 
 
-set testfile "recurse"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested recurse.exp
-     return -1
-}
-
-# Start with a fresh gdb.
+standard_testfile
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+    untested $testfile.exp
+    return -1
+}
 
 proc recurse_tests {} {
 
diff --git a/gdb/testsuite/gdb.base/relativedebug.exp b/gdb/testsuite/gdb.base/relativedebug.exp
index 90808f3..954401c 100644
--- a/gdb/testsuite/gdb.base/relativedebug.exp
+++ b/gdb/testsuite/gdb.base/relativedebug.exp
@@ -18,9 +18,8 @@ if [target_info exists gdb,nosignals] {
     continue
 }
 
-set testfile relativedebug
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     untested "Couldn't compile test program"
     return -1
@@ -28,10 +27,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 # Get things started.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 runto_main
 
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
index 9bb76aa..d69bca1 100644
--- a/gdb/testsuite/gdb.base/relocate.exp
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -16,9 +16,8 @@
 # relocate.exp -- Expect script to test loading symbols from unrelocated
 #		  object files.
 
-set testfile relocate
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}.o
+standard_testfile .c
+append binfile .o
 
 remote_exec build "rm -f ${binfile}"
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
index dfaf646..2738e47 100644
--- a/gdb/testsuite/gdb.base/remote.exp
+++ b/gdb/testsuite/gdb.base/remote.exp
@@ -20,9 +20,7 @@ if {! [is_remote target]} {
     return
 }
 
-set testfile "remote"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 gdb_start
 
diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp
index b0a2fc6..cee8b69 100644
--- a/gdb/testsuite/gdb.base/reread.exp
+++ b/gdb/testsuite/gdb.base/reread.exp
@@ -20,7 +20,7 @@ set prototypes 1
 set testfile1 "reread1"
 set srcfile1 ${testfile1}.c
 # Cygwin needs $EXEEXT.
-set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT
+set binfile1 [standard_output_file ${testfile1}$EXEEXT]
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {debug nowarnings}] != "" } {
     untested reread.exp
@@ -31,7 +31,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {d
 
 set testfile2 "reread2"
 set srcfile2 ${testfile2}.c
-set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT
+set binfile2 [standard_output_file ${testfile2}$EXEEXT]
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug nowarnings}] != ""
       && [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug nowarnings additional_flags=-DNO_SECTIONS}] != ""} {
@@ -42,7 +42,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {d
 # Start with a fresh gdb.
 
 set testfile "reread"
-set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
+set binfile [standard_output_file ${testfile}$EXEEXT]
 
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
diff --git a/gdb/testsuite/gdb.base/return-nodebug.exp b/gdb/testsuite/gdb.base/return-nodebug.exp
index 76be853..66c0a29 100644
--- a/gdb/testsuite/gdb.base/return-nodebug.exp
+++ b/gdb/testsuite/gdb.base/return-nodebug.exp
@@ -45,30 +45,16 @@ foreach type {{signed char} {short} {int} {long} {long long} {float} {double}} {
     set typeesc [string map {{ } {\ }} $type]
     set typenospace [string map {{ } -} $type]
 
-    set testfile "return-nodebug"
-    set srcfile ${testfile}.c
-    set srcfile1 ${testfile}1.c
-    set binfile ${objdir}/${subdir}/${testfile}-${typenospace}
+    standard_testfile .c return-nodebug1.c
 
     set additional_flags "additional_flags=-DTYPE=$typeesc"
 
-    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object [list debug $additional_flags]] != "" } {
+    if {[prepare_for_testing_full $testfile.exp \
+	     [list ${testfile}-${typenospace} debug \
+		  $srcfile [list debug $additional_flags] \
+		  $srcfile2 [list $additional_flags]]]} {
 	continue
     }
 
-    # This one is compiled without debug info.
-    if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object [list $additional_flags]] != "" } {
-	continue
-    }
-
-    if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug}] != "" } {
-	continue
-    }
-
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
-
     do_test $type
 }
diff --git a/gdb/testsuite/gdb.base/return2.exp b/gdb/testsuite/gdb.base/return2.exp
index 1bfad18..3b44415 100644
--- a/gdb/testsuite/gdb.base/return2.exp
+++ b/gdb/testsuite/gdb.base/return2.exp
@@ -16,9 +16,8 @@
 # This file was written by Michael Snyder (msnyder@redhat.com)
 
 
-set testfile "return2"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested return2.exp
      return -1
@@ -103,10 +102,7 @@ proc return2_tests { } {
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 set timeout 30
 return2_tests
-- 
1.8.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]