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.multi


I'm checking this in.

This changes gdb.multi to use standard_output_file.

It also fixes some slightly incorrect uses of prepare_for_testing --
this causes gdb to be restarted, but in these cases there is no reason
for this, and all it accomplishes is slowing down the test suite.  Using
build_executable is just as clean but doesn't cause the unneeded work.

gdb_compile_pthreads (along with the other various gdb_compile_* procs)
is another candidate for conversion to a prepare_for_testing /
build_executable "options" addition.

Regtested on x86-64 Fedora 16.

Tom

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

	* gdb.multi/watchpoint-multi.exp: Use standard_testfile.
	* gdb.multi/bkpt-multi-exec.exp: Use standard_output_file.  Use
	build_executable, not prepare_for_testing.
	* gdb.multi/base.exp: Use standard_output_file.  Use
	build_executable,  not prepare_for_testing.

Index: gdb.multi/base.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.multi/base.exp,v
retrieving revision 1.10
diff -u -r1.10 base.exp
--- gdb.multi/base.exp	4 Jan 2012 08:17:55 -0000	1.10
+++ gdb.multi/base.exp	25 Jun 2012 20:58:34 -0000
@@ -20,25 +20,25 @@
 
 set exec1 "hello"
 set srcfile1 ${exec1}.c
-set binfile1 ${objdir}/${subdir}/${exec1}
+set binfile1 [standard_output_file ${exec1}]
 
 set exec2 "hangout"
 set srcfile2 ${exec2}.c
-set binfile2 ${objdir}/${subdir}/${exec2}
+set binfile2 [standard_output_file ${exec2}]
 
 set exec3 "goodbye"
 set srcfile3 ${exec3}.c
-set binfile3 ${objdir}/${subdir}/${exec3}
+set binfile3 [standard_output_file ${exec3}]
 
-if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] } {
+if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] == -1 } {
     return -1
 }
 
-if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] } {
+if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] == -1} {
     return -1
 }
 
-if { [prepare_for_testing ${testfile}.exp ${exec3} "${srcfile3}" {debug nowarnings}] } {
+if { [build_executable ${testfile}.exp ${exec3} "${srcfile3}" {debug nowarnings}] == -1 } {
     return -1
 }
 
Index: gdb.multi/bkpt-multi-exec.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp,v
retrieving revision 1.7
diff -u -r1.7 bkpt-multi-exec.exp
--- gdb.multi/bkpt-multi-exec.exp	3 May 2012 02:05:15 -0000	1.7
+++ gdb.multi/bkpt-multi-exec.exp	25 Jun 2012 20:58:34 -0000
@@ -27,17 +27,17 @@
 
 set exec1 "bkpt-multi-exec"
 set srcfile1 ${exec1}.c
-set binfile1 ${objdir}/${subdir}/${exec1}
+set binfile1 [standard_output_file ${exec1}]
 
 set exec2 "crashme"
 set srcfile2 ${exec2}.c
-set binfile2 ${objdir}/${subdir}/${exec2}
+set binfile2 [standard_output_file ${exec2}]
 
-if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] } {
+if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] == -1 } {
     return -1
 }
 
-if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] } {
+if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] == -1 } {
     return -1
 }
 
Index: gdb.multi/watchpoint-multi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.multi/watchpoint-multi.exp,v
retrieving revision 1.2
diff -u -r1.2 watchpoint-multi.exp
--- gdb.multi/watchpoint-multi.exp	26 Jan 2012 10:09:43 -0000	1.2
+++ gdb.multi/watchpoint-multi.exp	25 Jun 2012 20:58:34 -0000
@@ -13,7 +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 "watchpoint-multi"
+standard_testfile
+set executable ${testfile}
 
 # Multiple inferiors are needed, therefore both native and extended gdbserver
 # modes are supported.  Only non-extended gdbserver is not supported.
@@ -29,10 +30,6 @@
     return
 }
 
-set executable ${testfile}
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${executable}
-
 if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     untested ${testfile}.exp
     return -1


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