test suite update - gdb.base/[t-z]
authorTom Tromey <tromey@redhat.com>
Thu, 27 Jun 2013 19:00:47 +0000 (19:00 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 27 Jun 2013 19:00:47 +0000 (19:00 +0000)
Convert files gdb.base/[t-z]*.exp to use standard_output_file et al.

* gdb.base/testenv.exp, gdb.base/tui-layout.exp,
gdb.base/twice.exp, gdb.base/type-opaque.exp, gdb.base/unload.exp,
gdb.base/unwindonsignal.exp, gdb.base/valgrind-db-attach.exp,
gdb.base/valgrind-infcall.exp, gdb.base/value-double-free.exp,
gdb.base/varargs.exp, gdb.base/watch-cond-infcall.exp,
gdb.base/watch-cond.exp, gdb.base/watch-non-mem.exp,
gdb.base/watch-read.exp, gdb.base/watch-vfork.exp,
gdb.base/watch_thread_num.exp, gdb.base/watchpoint-cond-gone.exp,
gdb.base/watchpoint-delete.exp, gdb.base/watchpoint-hw.exp,
gdb.base/watchpoint-solib.exp, gdb.base/watchpoint.exp,
gdb.base/watchpoints.exp, gdb.base/wchar.exp, gdb.base/whatis.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.

25 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/testenv.exp
gdb/testsuite/gdb.base/tui-layout.exp
gdb/testsuite/gdb.base/twice.exp
gdb/testsuite/gdb.base/type-opaque.exp
gdb/testsuite/gdb.base/unload.exp
gdb/testsuite/gdb.base/unwindonsignal.exp
gdb/testsuite/gdb.base/valgrind-db-attach.exp
gdb/testsuite/gdb.base/valgrind-infcall.exp
gdb/testsuite/gdb.base/value-double-free.exp
gdb/testsuite/gdb.base/varargs.exp
gdb/testsuite/gdb.base/watch-cond-infcall.exp
gdb/testsuite/gdb.base/watch-cond.exp
gdb/testsuite/gdb.base/watch-non-mem.exp
gdb/testsuite/gdb.base/watch-read.exp
gdb/testsuite/gdb.base/watch-vfork.exp
gdb/testsuite/gdb.base/watch_thread_num.exp
gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
gdb/testsuite/gdb.base/watchpoint-delete.exp
gdb/testsuite/gdb.base/watchpoint-hw.exp
gdb/testsuite/gdb.base/watchpoint-solib.exp
gdb/testsuite/gdb.base/watchpoint.exp
gdb/testsuite/gdb.base/watchpoints.exp
gdb/testsuite/gdb.base/wchar.exp
gdb/testsuite/gdb.base/whatis.exp

index ca53806c68b611d64d3db6c54cb3a42a55c5d79e..9727afc749dd42c60fb3d5b0b9fa43d80f816cae 100644 (file)
@@ -1,3 +1,19 @@
+2013-06-27  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.base/testenv.exp, gdb.base/tui-layout.exp,
+       gdb.base/twice.exp, gdb.base/type-opaque.exp, gdb.base/unload.exp,
+       gdb.base/unwindonsignal.exp, gdb.base/valgrind-db-attach.exp,
+       gdb.base/valgrind-infcall.exp, gdb.base/value-double-free.exp,
+       gdb.base/varargs.exp, gdb.base/watch-cond-infcall.exp,
+       gdb.base/watch-cond.exp, gdb.base/watch-non-mem.exp,
+       gdb.base/watch-read.exp, gdb.base/watch-vfork.exp,
+       gdb.base/watch_thread_num.exp, gdb.base/watchpoint-cond-gone.exp,
+       gdb.base/watchpoint-delete.exp, gdb.base/watchpoint-hw.exp,
+       gdb.base/watchpoint-solib.exp, gdb.base/watchpoint.exp,
+       gdb.base/watchpoints.exp, gdb.base/wchar.exp, gdb.base/whatis.exp:
+       Use standard_testfile, standard_output_file, prepare_for_testing,
+       clean_restart.
+
 2013-06-27  Tom Tromey  <tromey@redhat.com>
 
        * gdb.base/save-bp.exp, gdb.base/savedregs.exp,
index ae8d2fa3dae9fc1580eb126b87a01f98c2153fe9..e9a4d3d3d7fac219e25ded105c151fe80a12623c 100644 (file)
@@ -23,9 +23,7 @@ if { [is_remote target] } {
     return 0
 }
 
-set testfile "testenv"
-set srcfile ${testfile}.c
-set binfile ${testfile}
+standard_testfile .c
 
 # Compile binary
 # and start with a fresh gdb
index 265ead4c96994d0cf61577ac91134395d5b86da0..8f97b5469aacc156a8ca7855194e3970bf16e27d 100644 (file)
@@ -13,8 +13,9 @@
 # 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 tui-layout
-if { [prepare_for_testing ${testfile}.exp ${testfile} start.c] } {
+standard_testfile start.c
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile] } {
     return -1
 }
 
index fada7a10414fb35d3f99f7e19e4b75c3e43ec8dd..936ddcb1dfcae1177be9202116c997009ae853ea 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-set testfile twice-tmp
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_output_file twice.c
 set options debug
 lappend options "additional_flags=-I."
 
-set fileid [open ${objdir}/${subdir}/${srcfile} w]
+set local_srcfile [standard_output_file twice-tmp.c]
+set fileid [open $local_srcfile w]
 puts $fileid "#include \"twice.c\""
 close $fileid
 
 remote_download host ${srcdir}/${subdir}/twice.c twice.c
 
-if  { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable $options] != "" } {
+if  { [gdb_compile $local_srcfile "${binfile}" executable $options] != "" } {
      untested twice.exp
      return -1
 }
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+clean_restart $binfile
 
 if [runto_main] then {
     # Test that GDB can still detect whether we have line numbers
index 633d76328ab98b807c7a244f71fb834241b1368e..7caaeb1afe7afc9e6f73ce8231776cb9bb44672e 100644 (file)
@@ -19,13 +19,11 @@ if {[skip_shlib_tests]} {
     return -1
 }
 
-set testfile type-opaque-main
-set libfile type-opaque-lib
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile type-opaque-main.c
 
+set libfile type-opaque-lib
 set libsrc "${srcdir}/${subdir}/${libfile}.c"
-set libobj "${objdir}/${subdir}/${libfile}.so"
+set libobj [standard_output_file ${libfile}.so]
 set execsrc "${srcdir}/${subdir}/${srcfile}"
 
 remote_exec build "rm -f ${binfile}"
@@ -41,10 +39,7 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_load_shlibs ${libobj}
 
 if ![runto_main] then {
index 9198b3df1b90a7acd3d28333dcea47e46d172b83..adb2f052f471ba8213ac8a7b380dc3189a8b05cc 100644 (file)
@@ -31,12 +31,12 @@ set libname2 "${libfile2}.sl"
 set libsrcfile ${libfile}.c
 set libsrcfile2 ${libfile2}.c
 set srcfile $srcdir/$subdir/$testfile.c
-set binfile $objdir/$subdir/$testfile
-set shlibdir ${objdir}/${subdir}
+set binfile [standard_output_file $testfile]
+set shlibdir [standard_output_file {}]
 set libsrc  $srcdir/$subdir/$libfile.c
 set libsrc2  $srcdir/$subdir/$libfile2.c
-set lib_sl  $objdir/$subdir/$libname
-set lib_sl2  $objdir/$subdir/$libname2
+set lib_sl  [standard_output_file $libname]
+set lib_sl2  [standard_output_file $libname2]
 set lib_dlopen [shlib_target_file ${libname}]
 set lib_dlopen2 [shlib_target_file ${libname2}]
 set lib_syms [shlib_symbol_file ${libname}]
index cba27aad7aa6466e174950f921f5410238f6edc0..c3c040f45447d3cb729907336884541df83d242c 100644 (file)
@@ -24,15 +24,6 @@ if [target_info exists gdb,nosignals] {
 }
 
 
-set testfile "unwindonsignal"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested unwindonsignal.exp
-     return -1
-}
-
 # Some targets can't do function calls, so don't even bother with this
 # test.
 if [target_info exists gdb,cannot_call_functions] {
@@ -41,12 +32,12 @@ if [target_info exists gdb,cannot_call_functions] {
     continue
 }
 
-# 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
+}
 
 if { ![runto_main] } {
     fail "Can't run to main"
index b1e1ec62c69093a2f06c51f05d7f8ce29b852bc8..56c6914f2df18db38c2c2575e3753e9cef42afbe 100644 (file)
@@ -18,11 +18,8 @@ if [is_remote target] {
     return 0
 }
 
-set test valgrind-db-attach
-set srcfile $test.c
-set executable $test
-set binfile ${objdir}/${subdir}/${executable}
-if {[build_executable $test.exp $executable $srcfile {debug}] == -1} {
+standard_testfile .c
+if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
     return -1
 }
 
index 6d2893a8aea81428ef988b76f886c17b923bf29f..349b32d08fedf2a18e62ee13b8fcba17c1f08ebd 100644 (file)
@@ -18,11 +18,8 @@ if [is_remote target] {
     return 0
 }
 
-set test valgrind-infcall
-set srcfile $test.c
-set executable $test
-set binfile ${objdir}/${subdir}/${executable}
-if {[build_executable $test.exp $executable $srcfile {debug}] == -1} {
+standard_testfile .c
+if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
     return -1
 }
 
@@ -84,7 +81,7 @@ unset gdb_spawn_id
 set board [host_info name]
 unset_board_info fileid
 
-clean_restart $executable
+clean_restart $testfile
 
 gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb"
 
index f3d098f45c8d2a1d46ba3ae5cb8b19ef1caca6d2..f47a454699ad0efb00ef75220eac47ec0611e96e 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 value-double-free
-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}
-
 if ![runto_main] {
     return -1
 }
index 70de81dc3e770e05a3aa87be31e4a47c37280b73..7a427ff9ba4968255773a1c96c66ef2abde3e018 100644 (file)
@@ -30,9 +30,8 @@
 
 
 set prototypes 0
-set testfile "varargs"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+
+standard_testfile .c
 
 if [get_compiler_info] {
     return -1
@@ -56,10 +55,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
index 403ec84ae5d79bac41613918049308b153cd87fa..5dcec5b6f4196f1d50c83de04c4a5f63a667a17e 100644 (file)
@@ -16,9 +16,7 @@
 # Test for watchpoints with conditions that involve inferior function
 # calls.
 
-set testfile "watch-cond-infcall"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if { [build_executable ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
     untested ${testfile}.exp
index 184aacc31a85041ca07d4a683f4aca96538c1b85..2f2a05b58d604df7a2a22290ebc9eae5fb0ef48a 100644 (file)
@@ -17,9 +17,7 @@
 # Tests involving watchpoint conditions with local expressions.
 #
 
-set testfile "watch-cond"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
     untested ${testfile}.exp
index cb08985e10e05be4ceac4e60c778bde70c64939c..7e7e2bc136d7ae9990bd90d59762d26b551e2b80 100644 (file)
@@ -17,9 +17,7 @@
 # Tests watchpoints that watch expressions that don't involve memory.
 #
 
-set testfile "watch-non-mem"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
     untested ${testfile}.exp
index 9a5e38850205e53096c7d6582d4429a6253f8c12..95a6964aebad922a41a1b9b94f0a030d22cb5bd1 100644 (file)
@@ -22,8 +22,7 @@
 # watching the same memory as read watchpoints.
 #
 
-set testfile "watch-read"
-set srcfile ${testfile}.c
+standard_testfile .c
 
 if {[skip_hw_watchpoint_access_tests]} {
     return 0
index 51d8eae6f1ed463c5ed40c3b8418f4f7fe830ff4..bb1414715ecbf2422d8c3b8fe04f6acb4d9f6be3 100644 (file)
@@ -20,9 +20,9 @@ if { [is_remote target] } {
     return 0
 }
 
-global srcfile
-set testfile "watch-vfork"
-if { [build_executable ${testfile}.exp ${testfile} ${testfile}.c {debug}] } {
+standard_testfile .c
+
+if { [build_executable ${testfile}.exp ${testfile} $srcfile {debug}] } {
     untested ${testfile}.exp
     return -1
 }
index d8995fc58f5ec79d50156e37946455d4fdbe385a..fb0291737b2fa595dbfbbe62990eb2d59a253431 100644 (file)
@@ -25,9 +25,7 @@ if {[skip_hw_watchpoint_tests]} {
     return 0
 }
 
-set testfile watch_thread_num
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 # What compiler are we using?
 #
@@ -39,10 +37,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if { ![runto main] } then {
    fail "run to main"
index 44f1f7eb305e9b9335199c1bf9b680c78d96e669..9c908ca0dc1c0f2043f590da7c813877baaa1315 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 "watchpoint-cond-gone"
-set srcfile ${testfile}.c
-set srcfilestripped ${testfile}-stripped.c
-set objfilestripped ${objdir}/${subdir}/${testfile}-stripped.o
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c watchpoint-cond-gone-stripped.c
 
 # We need to generate a function without DWARF to crash older GDB.
 # Stepping into a dynamic function trampoline or stepping out of MAIN may work
 # but it is not a reliable FAIL case.
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfilestripped}" "${objfilestripped}" object {}] != ""
-      || [gdb_compile "${srcdir}/${subdir}/${srcfile} ${objfilestripped}" "${binfile}" executable {debug}] != "" } {
-    untested watchpoint-cond-gone.exp
+if {[prepare_for_testing_full $testfile.exp \
+        [list $testfile debug $srcfile debug $srcfile2 {}]]} {
+    untested $testfile.exp
     return -1
 }
 
-clean_restart ${testfile}
-
 # Problem does not occur otherwise.
 gdb_test_no_output "set can-use-hw-watchpoints 0"
 
index 0a32f1ec768a05fa25011fcf8820966375aa7008..6fc104274e8d2de30fa4e66f98efa1ac0e3d6c3e 100644 (file)
@@ -13,9 +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 "watchpoint-delete"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
 
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
     untested ${testfile}.exp
index a1e4def65a69183c884fc63e41e8d121c491b9a7..9021f41c38e1e6e910d6b23d384f44a4246a2237 100644 (file)
@@ -18,19 +18,13 @@ if {[skip_hw_watchpoint_tests]} {
     return 0
 }
 
-set testfile watchpoint-hw
-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
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 # Create the watchpoint before the inferior gets started.  Now the native CPU
 # target is still not active and its `to_can_use_hw_breakpoint' is not
 # installed, therefore only a software watchpoint gets created.
index b4fdb6999c0e675c5f5bb1a60639e6b06aa9f9f6..03ccf44a78ec308c6b8c07c21bd5851d9c38fe50 100644 (file)
@@ -26,10 +26,10 @@ set libfile "watchpoint-solib-shr"
 set libname "${libfile}.sl"
 set libsrcfile ${libfile}.c
 set srcfile $srcdir/$subdir/$testfile.c
-set binfile $objdir/$subdir/$testfile
-set shlibdir ${objdir}/${subdir}
+set binfile [standard_output_file $testfile]
+set shlibdir [standard_output_file {}]
 set libsrc  $srcdir/$subdir/$libfile.c
-set lib_sl  $objdir/$subdir/$libname
+set lib_sl  [standard_output_file $libname]
 set lib_dlopen [shlib_target_file ${libname}]
 set lib_syms [shlib_symbol_file ${libname}]
 
index 5961ef63baed97c769ab78b14ffcb71c1bc73ade..e0f7adc797a9b9f95949e035662882fa56587c6c 100644 (file)
@@ -16,9 +16,7 @@
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
 
-set testfile "watchpoint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 if [get_compiler_info] {
     return -1
index c26b7667e479d5093dfffcc0e20709c9a1ea98ea..7c10d819daeac4dac44b969a6aa20304ddf1e684 100644 (file)
@@ -16,9 +16,7 @@
 # This file was written by Pierre Muller. (muller@ics.u-strasbg.fr)
 
 
-set testfile "watchpoints"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 set wp_set 1
 
@@ -26,18 +24,11 @@ if [get_compiler_info] {
     return -1
 }
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested watchpoint.exp
-     return -1
+if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
+    untested $testfile.exp
+    return -1
 }
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
-
     # Disable hardware watchpoints if necessary.
     if [target_info exists gdb,no_hardware_watchpoints] {
         gdb_test_no_output "set can-use-hw-watchpoints 0" ""
index 8757cca4017aef1c398467d41d223db03418bd28..b3d30193853e0864436e5a124b3ac3c2e521a0bf 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 wchar
-set srcfile ${testfile}.c
+standard_testfile .c
+
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
     return -1
 }
index 40f317ad6804eac9d04fb428a0a1fc92e750bd73..7cfaf2b6f2cff329e20f6b96dc1ba62b478cbd64 100644 (file)
@@ -25,9 +25,8 @@ if [target_info exists no_long_long] {
     set exec_opts [list debug]
 }
 
-set testfile whatis
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .c
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $exec_opts] != "" } {
      untested whatis.exp
      return -1
@@ -41,10 +40,7 @@ if [get_compiler_info] {
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+clean_restart $binfile
 
 # Define a procedure to set up an xfail for all targets that put out a
 # `long' type as an `int' type.
This page took 0.049839 seconds and 4 git commands to generate.