This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR gas/3918: make check RUNTESTFLAGS=i386.exp doesn't work
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Mon, 5 Mar 2007 13:00:58 -0800
- Subject: PATCH: PR gas/3918: make check RUNTESTFLAGS=i386.exp doesn't work
The problem is gas_finish. runtest.exp will call ${tool}_finish if it
exists. But gas_finish isn't intended to be called by runtest.exp
and should only be used with gas_start. When
# make check RUNTESTFLAGS=i386.exp
is used, gas_finish is called without gas_start and closes the wrong
fd. We can rename gas_finish. But it is used in 250 places. This patch
adds gas_started to make sure that it will be used when gas_start.
H.J.
----
2007-03-05 H.J. Lu <hongjiu.lu@intel.com>
PR gas/3918
* lib/gas-defs.exp (gas_started): New variable. Initialized to
0.
(gas_start): Set gas_started to 1.
(gas_finish): Skip if gas_started is 0. Reset gas_started to 0.
--- gas/testsuite/lib/gas-defs.exp.test 2005-07-04 07:55:52.000000000 -0700
+++ gas/testsuite/lib/gas-defs.exp 2007-03-05 12:59:07.000000000 -0800
@@ -53,12 +53,17 @@ proc all_ones { args } {
return 1
}
+set gas_started 0
+
proc gas_start { prog as_opts } {
global AS
global ASFLAGS
global srcdir
global subdir
global spawn_id
+ global gas_started
+
+ set gas_started 1
verbose -log "Starting $AS $ASFLAGS $as_opts $prog" 2
catch {
@@ -71,9 +76,13 @@ proc gas_start { prog as_opts } {
proc gas_finish { } {
global spawn_id
+ global gas_started
- catch "close"
- catch "wait"
+ if { $gas_started == 1 } {
+ catch "close"
+ catch "wait"
+ set gas_started 0
+ }
}
proc want_no_output { testname } {