test suite update - gdb.base/[n-r]
authorTom Tromey <tromey@redhat.com>
Thu, 27 Jun 2013 18:53:49 +0000 (18:53 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 27 Jun 2013 18:53:49 +0000 (18:53 +0000)
Convert files gdb.base/[n-r]*.exp to use standard_output_file et al.

* gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
gdb.base/pending.exp, gdb.base/permissions.exp,
gdb.base/pie-execl.exp, gdb.base/pointers.exp,
gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
gdb.base/printcmds.exp, gdb.base/prologue.exp,
gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
gdb.base/ptype.exp, gdb.base/randomize.exp,
gdb.base/readline-ask.exp, gdb.base/recpar.exp,
gdb.base/recurse.exp, gdb.base/relativedebug.exp,
gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.

29 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/nextoverexit.exp
gdb/testsuite/gdb.base/nodebug.exp
gdb/testsuite/gdb.base/nofield.exp
gdb/testsuite/gdb.base/nostdlib.exp
gdb/testsuite/gdb.base/opaque.exp
gdb/testsuite/gdb.base/overlays.exp
gdb/testsuite/gdb.base/pc-fp.exp
gdb/testsuite/gdb.base/pending.exp
gdb/testsuite/gdb.base/permissions.exp
gdb/testsuite/gdb.base/pie-execl.exp
gdb/testsuite/gdb.base/pointers.exp
gdb/testsuite/gdb.base/pr11022.exp
gdb/testsuite/gdb.base/print-file-var.exp
gdb/testsuite/gdb.base/printcmds.exp
gdb/testsuite/gdb.base/prologue.exp
gdb/testsuite/gdb.base/psymtab.exp
gdb/testsuite/gdb.base/ptr-typedef.exp
gdb/testsuite/gdb.base/ptype.exp
gdb/testsuite/gdb.base/randomize.exp
gdb/testsuite/gdb.base/readline-ask.exp
gdb/testsuite/gdb.base/recpar.exp
gdb/testsuite/gdb.base/recurse.exp
gdb/testsuite/gdb.base/relativedebug.exp
gdb/testsuite/gdb.base/relocate.exp
gdb/testsuite/gdb.base/remote.exp
gdb/testsuite/gdb.base/reread.exp
gdb/testsuite/gdb.base/return-nodebug.exp
gdb/testsuite/gdb.base/return2.exp

index 7bf1fc76242e708c50b854d670ca0eb3c74e3af1..f577bae0832cc57a4f292ff47d85bae962c3fd62 100644 (file)
@@ -1,3 +1,21 @@
+2013-06-27  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
+       gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
+       gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
+       gdb.base/pending.exp, gdb.base/permissions.exp,
+       gdb.base/pie-execl.exp, gdb.base/pointers.exp,
+       gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
+       gdb.base/printcmds.exp, gdb.base/prologue.exp,
+       gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
+       gdb.base/ptype.exp, gdb.base/randomize.exp,
+       gdb.base/readline-ask.exp, gdb.base/recpar.exp,
+       gdb.base/recurse.exp, gdb.base/relativedebug.exp,
+       gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
+       gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
+       standard_testfile, standard_output_file, prepare_for_testing,
+       clean_restart.
+
 2013-06-27  Tom Tromey  <tromey@redhat.com>
 
        * hook-stop-continue.exp, hook-stop-frame.exp, huge.exp,
index 4f4529f5ee0523aa094525ed34a56e9da1ee9b03..6cf6f90bf3a878afdde615bfed66af143abed850 100644 (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/>.
 
-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
index e451b7b803157338ac0b5b21142b46c1c1a9b023..2c991dc0c8c0f1a3b4eed09859ec6c867ced3aac 100644 (file)
@@ -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 {
     
index 9b8ef062e786264cbb45f9f68315bd0fe576a695..bdaf6ca2990a14286a485d16b5fbbe3fbfecf6b1 100644 (file)
@@ -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}" \
index 177023cc0e4f520e74cd958ffe8dde0aaa7b493c..e139f3e46607d3804f5584abcfad34357f3ab31b 100644 (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/>.
 
-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"
index 3628e5cc2b2b1982f3e77b7244c09ecb2b168e39..94f04120271258ce8149cca40bbfb74d818f23c6 100644 (file)
 # 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).
index d2943784f6c5ba7aa70d2b53b7657ef4bcd5fb33..13d2463b5eb7a77f4c89096279c90cf6676bc339 100644 (file)
@@ -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
 }
index edf1d66d3efd59a91d133f3853886a05c4b4df2c..7bf2f3755dd8b526eb966185325a4c204c0758fb 100644 (file)
 # 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
index 1ab896abb027e2ee70d7cfa8299a7281a1aa74ba..1d621de3211733215944e85128b1d4408adc661d 100644 (file)
@@ -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]
index ed0e7e77226f2ac061f7ada9b42ef761753f23d7..00d71d4c54abce5953554078d80f3f643778d2f4 100644 (file)
 # 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
index f8e5e33c7b05f0bcc35909fd79609dcd9fb4b3a0..2bdccc15ede65168c43553c7925f3a00adcca103 100644 (file)
@@ -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
index 6b9c52d8c8dd911b9ed165bf59beedb3be8425d5..192b1393d0bd54136beceaed1b495c60fd39d9bd 100644 (file)
@@ -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}
 
 
 #
index 3465b74a8e32a9d575c42aa93bde0fd1aee80be5..86d7f04915d39d04e12e04800d22effcced06611 100644 (file)
@@ -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"
index fce4571f7727544fe1b34c1ba7ef5ce1c44e8a3c..41f00f643bd2d8101c1d9f6b01247631c1a45857 100644 (file)
@@ -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}]]
      != ""} {
index 316461a5dfe70e034f26f3bf4ca0741a86a6eb36..0597ab0d24d54a9039336e3e2493fdd3f110092c 100644 (file)
@@ -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
index 409c80e164a0869f227c2a228c4f7538282ffbb3..ebc1adfbc186463c8459c05c90f28cd6b326b358 100644 (file)
 
 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"
index 9c96536ff3f7913af112a0506d2cb1170a27429f..854455e02935e9be75b204db748dc7051883f506 100644 (file)
 
 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
index f0ef97a051972b7d3ad110c5f61221d0a9f88d46..d0d26283e13b71db820151d680377ac9ae5e8eb9 100644 (file)
@@ -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"
index bb186d3e8a07f68ffadc4a8a15030f1333219a6b..fdc04fee4b3f4bd84440288b4e56610cd997e5bc 100644 (file)
 # 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
index e84b4931e7d2288e83d2bb8f22a0f5ced7190a9b..7859906d2c84df6aa1a01f11ffe82958448edb50 100644 (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/>.
 
-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
 
index b71bd0ad50d761e65caab65f03c1dacd78864130..33f3b25db35cb5518e672689e84a1736225b10e3 100644 (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/>.
 
-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"
index fabd131d3f3f4eb35864475f8f81a264ab6dcaa8..699d8a62076404d5ced65cd9b9d836fcae16a5ca 100644 (file)
@@ -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
 }
index da635bf3b48321ae89ce789f3c87346d04b6bfdf..7155808c93c6cf59096a4d33e42da60ddc4bce7f 100644 (file)
 # 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 {} {
 
index 90808f32a8dc423902309487ad95eef9848ab68d..954401cb064663767855cc4fdcc9f659a21d9ab7 100644 (file)
@@ -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
 
index 9bb76aa3344ef03392688c0d05839cfcddafe7a3..d69bca1947c88e2e1410aca8ba21599448ff515a 100644 (file)
@@ -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}] != "" } {
index dfaf646ef35e783c15707391d439466e839d2ac6..2738e47fdb9b313f188d579433ce670cff735ff7 100644 (file)
@@ -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
 
index b0a2fc60a6673b9df05359d82b5e846f45714d75..cee8b69a782b2fb696c1e72f503d041d6a8894ce 100644 (file)
@@ -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
index 76be8536a4388aab01748151e21b48c4fdcf736c..66c0a29cd0c36d8b97c6be1ac560d0ca77cbd75d 100644 (file)
@@ -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
 }
index 1bfad18acce2fd6ad032749a89ec9d5c36574f11..3b44415ce14265253d79eb4af82b43cdb4be7aef 100644 (file)
@@ -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
This page took 0.070457 seconds and 4 git commands to generate.