This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Remove output file first when run test


When there is an error in test, run_dump_test doesn't touch the
output file.  If the previous output file happens to contain the
expected output, we won't see the error. This patch to remove the
output file first.


H.J.
----
2007-01-17  H.J. Lu  <hongjiu.lu@intel.com>

	* lib/ld-lib.exp (run_dump_test): Remove output file first.

--- lib/ld-lib.exp.error	2006-12-13 09:03:24.000000000 -0800
+++ lib/ld-lib.exp	2007-01-17 17:34:15.000000000 -0800
@@ -783,6 +783,7 @@ proc run_dump_test { name } {
 	set sourcefile [lindex $sourcefiles $i]
 
 	set objfile "tmpdir/dump$i.o"
+	catch "exec rm -f $objfile" exec_output
 	lappend objfiles $objfile
 	set cmd "$AS $ASFLAGS $opts(as) $asflags($sourcefile) -o $objfile $sourcefile"
 
@@ -814,6 +815,7 @@ proc run_dump_test { name } {
     # Perhaps link the file(s).
     if { $run_ld } {
 	set objfile "tmpdir/dump"
+	catch "exec rm -f $objfile" exec_output
 
 	# Add -L$srcdir/$subdir so that the linker command can use
 	# linker scripts in the source directory.
@@ -840,6 +842,7 @@ proc run_dump_test { name } {
 	if { $cmdret == 0 && $run_objcopy } {
 	    set infile $objfile
 	    set objfile "tmpdir/dump1"
+	    catch "exec rm -f $objfile" exec_output
 
 	    # Note that we don't use OBJCOPYFLAGS here; any flags must be
 	    # explicitly specified.
@@ -879,6 +882,7 @@ proc run_dump_test { name } {
 	}
     } else {
 	set objfile "tmpdir/dump0.o"
+	catch "exec rm -f $objfile" exec_output
     }
 
     # We must not have expected failure if we get here.


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