summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-06-10 08:19:53 (GMT)
committerSteven Knight <knight@baldmt.com>2010-06-10 08:19:53 (GMT)
commit1dc992070b764deba45742ca3325938c6162e995 (patch)
treeb411e36b1daa61aa76395d4d11153fe6a4b693c6
parentb9bf799d4ee594f37b3a404a4e18dbee3fe56533 (diff)
downloadSCons-1dc992070b764deba45742ca3325938c6162e995.zip
SCons-1dc992070b764deba45742ca3325938c6162e995.tar.gz
SCons-1dc992070b764deba45742ca3325938c6162e995.tar.bz2
Increase the default timeout of TestSCons.wait_for() to 20.0 seconds.
(--interactive mode on our Solaris buildbot slave takes longer than 10 seconds to create the necessary marker files.) Set the stdin attribute on our popen object to None after we close it, so some versions of subprocess.py don't try to write it after it's closed. If we time out waiting for a marker file to be created, then print any stdout or stderr that's already accumulated, since that may give clues about why the test failed.
-rw-r--r--QMTest/TestSCons.py11
-rw-r--r--test/Fortran/SHF77FLAGS.py4
-rw-r--r--test/Fortran/SHF90FLAGS.py4
-rw-r--r--test/Fortran/SHF95FLAGS.py4
-rw-r--r--test/Fortran/SHFORTRANFLAGS.py4
-rw-r--r--test/packaging/tar/gz.py2
6 files changed, 19 insertions, 10 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index 5f2b958..9269678 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -1062,7 +1062,7 @@ print py_ver
restore_sconsflags(sconsflags)
return p
- def wait_for(self, fname, timeout=10.0, popen=None):
+ def wait_for(self, fname, timeout=20.0, popen=None):
"""
Waits for the specified file name to exist.
"""
@@ -1072,8 +1072,17 @@ print py_ver
sys.stderr.write('timed out waiting for %s to exist\n' % fname)
if popen:
popen.stdin.close()
+ popen.stdin = None
self.status = 1
self.finish(popen)
+ stdout = self.stdout()
+ if stdout:
+ sys.stdout.write(self.banner('STDOUT ') + '\n')
+ sys.stdout.write(stdout)
+ stderr = self.stderr()
+ if stderr:
+ sys.stderr.write(self.banner('STDERR ') + '\n')
+ sys.stderr.write(stderr)
self.fail_test()
time.sleep(1.0)
waited = waited + 1.0
diff --git a/test/Fortran/SHF77FLAGS.py b/test/Fortran/SHF77FLAGS.py
index 7d55a91..644b827 100644
--- a/test/Fortran/SHF77FLAGS.py
+++ b/test/Fortran/SHF77FLAGS.py
@@ -38,11 +38,11 @@ test = TestSCons.TestSCons()
test.write('myg77.py', r"""
import getopt
import sys
-opts, args = getopt.getopt(sys.argv[1:], 'cf:o:x')
+opts, args = getopt.getopt(sys.argv[1:], 'cf:K:o:x')
optstring = ''
for opt, arg in opts:
if opt == '-o': out = arg
- elif opt != '-f': optstring = optstring + ' ' + opt
+ elif opt not in ('-f', '-K'): optstring = optstring + ' ' + opt
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
outfile.write(optstring + "\n")
diff --git a/test/Fortran/SHF90FLAGS.py b/test/Fortran/SHF90FLAGS.py
index 7ff3a43..d5066c6 100644
--- a/test/Fortran/SHF90FLAGS.py
+++ b/test/Fortran/SHF90FLAGS.py
@@ -39,11 +39,11 @@ test.write('myfortran.py', r"""
import getopt
import sys
comment = '#' + sys.argv[1]
-opts, args = getopt.getopt(sys.argv[2:], 'cf:o:xy')
+opts, args = getopt.getopt(sys.argv[2:], 'cf:K:o:xy')
optstring = ''
for opt, arg in opts:
if opt == '-o': out = arg
- elif opt != '-f': optstring = optstring + ' ' + opt
+ elif opt not in ('-f', '-K'): optstring = optstring + ' ' + opt
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
outfile.write(optstring + "\n")
diff --git a/test/Fortran/SHF95FLAGS.py b/test/Fortran/SHF95FLAGS.py
index b809d22..b945bac 100644
--- a/test/Fortran/SHF95FLAGS.py
+++ b/test/Fortran/SHF95FLAGS.py
@@ -39,11 +39,11 @@ test.write('myfortran.py', r"""
import getopt
import sys
comment = '#' + sys.argv[1]
-opts, args = getopt.getopt(sys.argv[2:], 'cf:o:xy')
+opts, args = getopt.getopt(sys.argv[2:], 'cf:K:o:xy')
optstring = ''
for opt, arg in opts:
if opt == '-o': out = arg
- elif opt != '-f': optstring = optstring + ' ' + opt
+ elif opt not in ('-f', '-K'): optstring = optstring + ' ' + opt
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
outfile.write(optstring + "\n")
diff --git a/test/Fortran/SHFORTRANFLAGS.py b/test/Fortran/SHFORTRANFLAGS.py
index 65f6a6c..11116f4 100644
--- a/test/Fortran/SHFORTRANFLAGS.py
+++ b/test/Fortran/SHFORTRANFLAGS.py
@@ -37,11 +37,11 @@ test = TestSCons.TestSCons()
test.write('myfortran.py', r"""
import getopt
import sys
-opts, args = getopt.getopt(sys.argv[1:], 'cf:o:x')
+opts, args = getopt.getopt(sys.argv[1:], 'cf:K:o:x')
optstring = ''
for opt, arg in opts:
if opt == '-o': out = arg
- elif opt != '-f': optstring = optstring + ' ' + opt
+ elif opt not in ('-f', '-K'): optstring = optstring + ' ' + opt
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
outfile.write(optstring + "\n")
diff --git a/test/packaging/tar/gz.py b/test/packaging/tar/gz.py
index 052adc2..f841c59 100644
--- a/test/packaging/tar/gz.py
+++ b/test/packaging/tar/gz.py
@@ -45,7 +45,7 @@ int main( int argc, char* argv[] )
{
return 0;
}
- """)
+""")
test.write('SConstruct', """
Program( 'src/main.c' )