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]

FYI: clean up gdb.fortran


I'm checking this in.

This changes gdb.fortran to use standard_testfile, standard_output_file,
and prepare_for_testing.

Regtested on x86-64 Fedora 16.

Tom

2012-06-25  Tom Tromey  <tromey@redhat.com>

	* gdb.fortran/subarray.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.fortran/multi-dim.exp: Use standard_testfile.
	* gdb.fortran/module.exp: Use standard_testfile.
	* gdb.fortran/logical.exp: Use standard_testfile.
	* gdb.fortran/library-module.exp: Use standard_testfile,
	standard_output_file.
	* gdb.fortran/derived-type.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.fortran/complex.exp: Use standard_testfile,
	prepare_for_testing.
	* gdb.fortran/charset.exp: Use standard_testfile.
	* gdb.fortran/array-element.exp: Use standard_testfile,
	prepare_for_testing.

Index: gdb.fortran/array-element.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/array-element.exp,v
retrieving revision 1.13
diff -u -r1.13 array-element.exp
--- gdb.fortran/array-element.exp	16 Jan 2012 16:21:45 -0000	1.13
+++ gdb.fortran/array-element.exp	25 Jun 2012 20:48:07 -0000
@@ -20,20 +20,12 @@
 
 if { [skip_fortran_tests] } { return -1 }
 
-set testfile "array-element"
-set srcfile ${testfile}.f
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .f
 
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	 executable {debug f90}] != ""} {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if ![runto sub_] then {
     perror "couldn't run to breakpoint sub_"
     continue
Index: gdb.fortran/charset.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/charset.exp,v
retrieving revision 1.2
diff -u -r1.2 charset.exp
--- gdb.fortran/charset.exp	4 Jan 2012 08:17:51 -0000	1.2
+++ gdb.fortran/charset.exp	25 Jun 2012 20:48:07 -0000
@@ -18,8 +18,7 @@
 
 if { [skip_fortran_tests] } { return -1 }
 
-set testfile "charset"
-set srcfile ${testfile}.f90
+standard_testfile .f90
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug additional_flags=-fbackslash f90}] } {
     return -1
 }
Index: gdb.fortran/complex.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/complex.exp,v
retrieving revision 1.8
diff -u -r1.8 complex.exp
--- gdb.fortran/complex.exp	4 Jan 2012 08:17:51 -0000	1.8
+++ gdb.fortran/complex.exp	25 Jun 2012 20:48:07 -0000
@@ -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 "complex"
-set srcfile ${testfile}.f
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .f
 
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	  executable {debug f90 quiet}] != "" } {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90 quiet}]} {
     untested "Couldn't compile ${srcfile}"
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if ![runto MAIN__] then {
     perror "Couldn't run to MAIN__"
     continue
Index: gdb.fortran/derived-type.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/derived-type.exp,v
retrieving revision 1.14
diff -u -r1.14 derived-type.exp
--- gdb.fortran/derived-type.exp	16 Jan 2012 16:21:45 -0000	1.14
+++ gdb.fortran/derived-type.exp	25 Jun 2012 20:48:07 -0000
@@ -20,20 +20,12 @@
 
 if { [skip_fortran_tests] } { return -1 }
 
-set testfile "derived-type"
-set srcfile ${testfile}.f90
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .f90
 
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	 executable {debug f90}] != ""} {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if ![runto MAIN__] then {
     perror "couldn't run to breakpoint MAIN__"
     continue
Index: gdb.fortran/library-module.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/library-module.exp,v
retrieving revision 1.6
diff -u -r1.6 library-module.exp
--- gdb.fortran/library-module.exp	21 Jun 2012 20:46:23 -0000	1.6
+++ gdb.fortran/library-module.exp	25 Jun 2012 20:48:07 -0000
@@ -13,11 +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 "library-module"
-set srcfile ${testfile}-main.f90
+standard_testfile library-module-main.f90 
 set srclibfile ${testfile}-lib.f90
-set libfile ${testfile}-lib.so
-set binfile ${testfile}
+set libfile [standard_output_file ${testfile}-lib.so]
 
 # Required for -fPIC by gdb_compile_shlib.
 if [get_compiler_info] {
@@ -25,7 +23,7 @@
    return -1
 }
 
-if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $objdir/$subdir/$libfile {debug f90}] != "" } {
+if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $libfile {debug f90}] != "" } {
     untested "Couldn't compile ${srclibfile}"
     return -1
 }
@@ -34,14 +32,14 @@
 # just for the linking phase (and not the source compilation phase).  And any
 # warnings on ignored $libfile abort the process.
 
-if  { [gdb_compile $srcdir/$subdir/$srcfile $objdir/$subdir/$binfile executable [list debug f90 shlib=$objdir/$subdir/$libfile]] != "" } {
+if  { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug f90 shlib=$libfile]] != "" } {
     untested "Couldn't compile ${srcfile}"
     return -1
 }
 
-clean_restart $binfile
+clean_restart $testfile
 
-gdb_load_shlibs $objdir/$subdir/$libfile
+gdb_load_shlibs $libfile
 
 if ![runto MAIN__] then {
     perror "couldn't run to breakpoint MAIN__"
Index: gdb.fortran/logical.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/logical.exp,v
retrieving revision 1.4
diff -u -r1.4 logical.exp
--- gdb.fortran/logical.exp	4 Jan 2012 08:17:51 -0000	1.4
+++ gdb.fortran/logical.exp	25 Jun 2012 20:48:07 -0000
@@ -16,11 +16,9 @@
 
 # This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
 
-set test "logical"
-set srcfile ${test}.f90
+standard_testfile .f90
 
-if { [prepare_for_testing "${test}.exp" "${test}" "${srcfile}" {debug f90 quiet}] } {
-    untested "Could not compile ${srcfile}."
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90 quiet}]} {
     return -1
 }
 
Index: gdb.fortran/module.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/module.exp,v
retrieving revision 1.9
diff -u -r1.9 module.exp
--- gdb.fortran/module.exp	4 Jan 2012 08:17:51 -0000	1.9
+++ gdb.fortran/module.exp	25 Jun 2012 20:48:07 -0000
@@ -13,8 +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 "module"
-set srcfile ${testfile}.f90
+standard_testfile .f90
 
 if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
     return -1
Index: gdb.fortran/multi-dim.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/multi-dim.exp,v
retrieving revision 1.3
diff -u -r1.3 multi-dim.exp
--- gdb.fortran/multi-dim.exp	4 Jan 2012 08:17:51 -0000	1.3
+++ gdb.fortran/multi-dim.exp	25 Jun 2012 20:48:07 -0000
@@ -18,8 +18,8 @@
 
 if { [skip_fortran_tests] } { return -1 }
 
-set testfile "multi-dim"
-set srcfile ${testfile}.f90
+standard_testfile .f90
+
 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
     return -1
 }
Index: gdb.fortran/subarray.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/subarray.exp,v
retrieving revision 1.14
diff -u -r1.14 subarray.exp
--- gdb.fortran/subarray.exp	16 Jan 2012 16:21:45 -0000	1.14
+++ gdb.fortran/subarray.exp	25 Jun 2012 20:48:07 -0000
@@ -20,12 +20,9 @@
 
 if { [skip_fortran_tests] } { return -1 }
 
-set testfile "subarray"
-set srcfile ${testfile}.f
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .f
 
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	executable {debug f90}] != ""} {
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
     return -1
 }
 


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