summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranatoly techtonik <techtonik@gmail.com>2012-12-17 07:28:48 +0300
committeranatoly techtonik <techtonik@gmail.com>2012-12-17 07:28:48 +0300
commit7063b9b23a75a0ad1d7673b68aa5a695d05c28b8 (patch)
treeda17cf471dce22482cdc227902e9932ed45d9edd
parent4bf5da671c402c1c96adbef12e5781680426f8a4 (diff)
parent4c27ebce44de8151420851cb36f639733c856056 (diff)
downloadscons-7063b9b23a75a0ad1d7673b68aa5a695d05c28b8.tar.gz
Merge runtest.py fixes
-rw-r--r--QMTest/TestCommon.py31
-rw-r--r--QMTest/TestSCons.py28
-rw-r--r--QMTest/TestSCons_time.py2
-rw-r--r--README.rst1
-rw-r--r--runtest.py141
-rw-r--r--src/CHANGES.txt1
-rw-r--r--test/Delete.py1
-rw-r--r--test/Errors/execute-a-directory.py47
-rw-r--r--test/Errors/non-executable-file.py38
-rw-r--r--test/Errors/nonexistent-executable.py53
-rw-r--r--test/Execute.py20
-rw-r--r--test/Install/Install.py1
-rw-r--r--test/Interactive/shell.py16
-rw-r--r--test/Object.py6
-rw-r--r--test/Repository/StaticLibrary.py11
-rw-r--r--test/scons-time/func/file.py11
16 files changed, 238 insertions, 170 deletions
diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py
index 90aaed25..6d47149b 100644
--- a/QMTest/TestCommon.py
+++ b/QMTest/TestCommon.py
@@ -286,11 +286,17 @@ class TestCommon(TestCmd):
print "Unwritable files: `%s'" % "', `".join(unwritable)
self.fail_test(missing + unwritable)
- def must_contain(self, file, required, mode = 'rb'):
+ def must_contain(self, file, required, mode = 'rb', find = None):
"""Ensures that the specified file contains the required text.
"""
file_contents = self.read(file, mode)
- contains = (file_contents.find(required) != -1)
+ if find is None:
+ def find(o, l):
+ try:
+ return o.index(l)
+ except ValueError:
+ return None
+ contains = find(file_contents, required)
if not contains:
print "File `%s' does not contain required string." % file
print self.banner('Required string ')
@@ -317,6 +323,9 @@ class TestCommon(TestCmd):
except ValueError:
return None
missing = []
+ if is_List(output):
+ output = '\n'.join(output)
+
for line in lines:
if find(output, line) is None:
missing.append(line)
@@ -415,9 +424,9 @@ class TestCommon(TestCmd):
sys.stdout.flush()
self.fail_test()
- def must_contain_lines(self, lines, output, title=None):
+ def must_contain_lines(self, lines, output, title=None, find = None):
# Deprecated; retain for backwards compatibility.
- return self.must_contain_all_lines(output, lines, title)
+ return self.must_contain_all_lines(output, lines, title, find)
def must_exist(self, *files):
"""Ensures that the specified file(s) must exist. An individual
@@ -467,11 +476,17 @@ class TestCommon(TestCmd):
self.diff(expect, file_contents, 'contents ')
raise
- def must_not_contain(self, file, banned, mode = 'rb'):
+ def must_not_contain(self, file, banned, mode = 'rb', find = None):
"""Ensures that the specified file doesn't contain the banned text.
"""
file_contents = self.read(file, mode)
- contains = (file_contents.find(banned) != -1)
+ if find is None:
+ def find(o, l):
+ try:
+ return o.index(l)
+ except ValueError:
+ return None
+ contains = find(file_contents, banned)
if contains:
print "File `%s' contains banned string." % file
print self.banner('Banned string ')
@@ -512,8 +527,8 @@ class TestCommon(TestCmd):
sys.stdout.write(output)
self.fail_test()
- def must_not_contain_lines(self, lines, output, title=None):
- return self.must_not_contain_any_line(output, lines, title)
+ def must_not_contain_lines(self, lines, output, title=None, find=None):
+ return self.must_not_contain_any_line(output, lines, title, find)
def must_not_exist(self, *files):
"""Ensures that the specified file(s) must not exist.
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index 296af67e..ea18757c 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -108,7 +108,35 @@ def re_escape(str):
str = str.replace(c, '\\' + c)
return str
+#
+# Helper functions that we use as a replacement to the default re.match
+# when searching for special strings in stdout/stderr.
+#
+def search_re(out, l):
+ """ Search the regular expression 'l' in the output 'out'
+ and return the start index when successful.
+ """
+ m = re.search(l, out)
+ if m:
+ return m.start()
+
+ return None
+
+def search_re_in_list(out, l):
+ """ Search the regular expression 'l' in each line of
+ the given string list 'out' and return the line's index
+ when successful.
+ """
+ for idx, o in enumerate(out):
+ m = re.search(l, o)
+ if m:
+ return idx
+
+ return None
+#
+# Helpers for handling Python version numbers
+#
def python_version_string():
return sys.version.split()[0]
diff --git a/QMTest/TestSCons_time.py b/QMTest/TestSCons_time.py
index 4a759c0f..abe8ccf1 100644
--- a/QMTest/TestSCons_time.py
+++ b/QMTest/TestSCons_time.py
@@ -21,6 +21,8 @@ import sys
from TestCommon import *
from TestCommon import __all__
+# some of the scons_time tests may need regex-based matching:
+from TestSCons import search_re, search_re_in_list
__all__.extend([ 'TestSCons_time',
])
diff --git a/README.rst b/README.rst
index d2492baf..862d323c 100644
--- a/README.rst
+++ b/README.rst
@@ -751,3 +751,4 @@ With plenty of help from the SCons Development team:
\... and many others.
__COPYRIGHT__
+
diff --git a/runtest.py b/runtest.py
index e482dc69..e19201cc 100644
--- a/runtest.py
+++ b/runtest.py
@@ -92,6 +92,14 @@ import stat
import sys
import time
+try:
+ import threading
+ import Queue # 2to3: rename to queue
+ threading_ok = True
+except ImportError:
+ print "Can't import threading or queue"
+ threading_ok = False
+
cwd = os.getcwd()
baseline = 0
@@ -100,6 +108,7 @@ external = 0
debug = ''
execute_tests = 1
format = None
+jobs = 1
list_only = None
printcommand = 1
package = None
@@ -170,38 +179,39 @@ Environment Variables:
PRESERVE, PRESERVE_{PASS,FAIL,NO_RESULT}: preserve test subdirs
TESTCMD_VERBOSE: turn on verbosity in TestCommand
"""
-
-
-# "Pass-through" option parsing -- an OptionParser that ignores
-# unknown options and lets them pile up in the leftover argument
-# list. Useful to gradually port getopt to optparse.
-
-from optparse import OptionParser, BadOptionError
-
-class PassThroughOptionParser(OptionParser):
- def _process_long_opt(self, rargs, values):
- try:
- OptionParser._process_long_opt(self, rargs, values)
- except BadOptionError, err:
- self.largs.append(err.opt_str)
- def _process_short_opts(self, rargs, values):
- try:
- OptionParser._process_short_opts(self, rargs, values)
- except BadOptionError, err:
- self.largs.append(err.opt_str)
-
-parser = PassThroughOptionParser(add_help_option=False)
-parser.add_option('-a', '--all', action='store_true',
- help="Run all tests.")
-(options, args) = parser.parse_args()
-
-#print "options:", options
-#print "args:", args
-
-
-opts, args = getopt.getopt(args, "3b:def:hklno:P:p:qsv:Xx:t",
+
+
+# "Pass-through" option parsing -- an OptionParser that ignores
+# unknown options and lets them pile up in the leftover argument
+# list. Useful to gradually port getopt to optparse.
+
+from optparse import OptionParser, BadOptionError
+
+class PassThroughOptionParser(OptionParser):
+ def _process_long_opt(self, rargs, values):
+ try:
+ OptionParser._process_long_opt(self, rargs, values)
+ except BadOptionError, err:
+ self.largs.append(err.opt_str)
+ def _process_short_opts(self, rargs, values):
+ try:
+ OptionParser._process_short_opts(self, rargs, values)
+ except BadOptionError, err:
+ self.largs.append(err.opt_str)
+
+parser = PassThroughOptionParser(add_help_option=False)
+parser.add_option('-a', '--all', action='store_true',
+ help="Run all tests.")
+(options, args) = parser.parse_args()
+
+#print "options:", options
+#print "args:", args
+
+
+opts, args = getopt.getopt(args, "3b:def:hj:klno:P:p:qsv:Xx:t",
['baseline=', 'builddir=',
'debug', 'external', 'file=', 'help', 'no-progress',
+ 'jobs=',
'list', 'no-exec', 'noqmtest', 'nopipefiles', 'output=',
'package=', 'passed', 'python=', 'qmtest',
'quiet', 'short-progress', 'time',
@@ -232,6 +242,8 @@ for o, a in opts:
elif o in ['-h', '--help']:
print helpstr
sys.exit(0)
+ elif o in ['-j', '--jobs']:
+ jobs = int(a)
elif o in ['-k', '--no-progress']:
print_progress = 0
elif o in ['-l', '--list']:
@@ -793,7 +805,11 @@ else:
total_start_time = time_func()
total_num_tests = len(tests)
-for idx,t in enumerate(tests):
+tests_completed = 0
+
+def run_test(t, io_lock, async=True):
+ global tests_completed
+ header = ""
command_args = ['-tt']
if python3incompatibilities:
command_args.append('-3')
@@ -804,12 +820,16 @@ for idx,t in enumerate(tests):
t.command_str = " ".join([escape(python)] + command_args)
if printcommand:
if print_progress:
- sys.stdout.write("%d/%d (%.2f%s) %s\n" % (idx+1, total_num_tests,
- float(idx+1)*100.0/float(total_num_tests),
- '%',
- t.command_str))
+ tests_completed += 1
+ n = tests_completed # approx indicator of where we are
+ header += ("%d/%d (%.2f%s) %s\n" % (n, total_num_tests,
+ float(n)*100.0/float(total_num_tests),
+ '%',
+ t.command_str))
else:
- sys.stdout.write(t.command_str + "\n")
+ header += t.command_str + "\n"
+ if not suppress_stdout and not suppress_stderr:
+ sys.stdout.write(header)
head, tail = os.path.split(t.abspath)
if head:
os.environ['PYTHON_SCRIPT_DIR'] = head
@@ -818,13 +838,54 @@ for idx,t in enumerate(tests):
test_start_time = time_func()
if execute_tests:
t.execute()
- if not suppress_stdout and t.stdout:
- print t.stdout
- if not suppress_stderr and t.stderr:
- print t.stderr
t.test_time = time_func() - test_start_time
+ if io_lock:
+ io_lock.acquire()
+ if suppress_stdout or suppress_stderr:
+ sys.stdout.write(header)
+ if not suppress_stdout and t.stdout:
+ print t.stdout
+ if not suppress_stderr and t.stderr:
+ print t.stderr
print_time_func("Test execution time: %.1f seconds\n", t.test_time)
+ if io_lock:
+ io_lock.release()
+
+class RunTest(threading.Thread):
+ def __init__(self, queue, io_lock):
+ threading.Thread.__init__(self)
+ self.queue = queue
+ self.io_lock = io_lock
+
+ def run(self):
+ while True:
+ t = self.queue.get()
+ run_test(t, io_lock, True)
+ self.queue.task_done()
+
+if jobs > 1 and threading_ok:
+ print "Running tests using %d jobs"%jobs
+ # Start worker threads
+ queue = Queue.Queue()
+ io_lock = threading.Lock()
+ for i in range(1, jobs):
+ t = RunTest(queue, io_lock)
+ t.daemon = True
+ t.start()
+ # Give tasks to workers
+ for t in tests:
+ queue.put(t)
+ queue.join()
+else:
+ # Run tests serially
+ if jobs > 1:
+ print "Ignoring -j%d option; no python threading module available."%jobs
+ for t in tests:
+ run_test(t, None, False)
+
+# all tests are complete by the time we get here
+
if len(tests) > 0:
tests[0].total_time = time_func() - total_start_time
print_time_func("Total execution time for all tests: %.1f seconds\n", tests[0].total_time)
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 18b2c186..90846940 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -45,6 +45,7 @@ RELEASE 2.X.X -
* removed Aegis support from runtest.py. (#2872)
From Gary Oberbrunner:
+ - Add -jN support to runtest.py to run tests in parallel
- Add MSVC10 and MSVC11 support to get_output low-level bat script runner.
- Fix MSVS solution generation for VS11, and fixed tests.
diff --git a/test/Delete.py b/test/Delete.py
index 49b46001..94ba24aa 100644
--- a/test/Delete.py
+++ b/test/Delete.py
@@ -212,6 +212,7 @@ fail_strings = [
"No such file or directory",
"The system cannot find the file specified",
"The system cannot find the path specified",
+ "Das System kann die angegebene Datei nicht finden",
]
test.must_contain_any_line(test.stderr(), fail_strings)
diff --git a/test/Errors/execute-a-directory.py b/test/Errors/execute-a-directory.py
index 1b679c6e..1d2036e3 100644
--- a/test/Errors/execute-a-directory.py
+++ b/test/Errors/execute-a-directory.py
@@ -53,63 +53,58 @@ Bad command or file name
"""
unrecognized = """\
-'%s' is not recognized as an internal or external command,
+'.+' is not recognized as an internal or external command,
operable program or batch file.
-scons: *** [%s] Error 1
+scons: \*\*\* \[%s\] Error 1
"""
unspecified = """\
The name specified is not recognized as an
internal or external command, operable program or batch file.
-scons: *** [%s] Error 1
+scons: \*\*\* \[%s\] Error 1
"""
cannot_execute = """\
-%s: cannot execute
-scons: *** [%s] Error %s
-"""
-
-Permission_denied = """\
-%s: Permission denied
-scons: *** [%s] Error %s
+(sh: )*.+: cannot execute
+scons: \*\*\* \[%s\] Error %s
"""
permission_denied = """\
-%s: permission denied
-scons: *** [%s] Error %s
+.+: (p|P)ermission denied
+scons: \*\*\* \[%s\] Error %s
"""
is_a_directory = """\
-%s: is a directory
-scons: *** [%s] Error %s
+.+: (i|I)s a directory
+scons: \*\*\* \[%s\] Error %s
"""
-Is_a_directory = """\
-%s: Is a directory
-scons: *** [%s] Error %s
+konnte_nicht_gefunden_werden = """\
+Der Befehl ".+" ist entweder falsch geschrieben oder
+konnte nicht gefunden werden.
+scons: \*\*\* \[%s\] Error %s
"""
test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
if os.name == 'nt':
errs = [
bad_command,
- unrecognized % (test.workdir, 'f3'),
+ unrecognized % 'f3',
+ konnte_nicht_gefunden_werden % ('f3', 1),
unspecified % 'f3'
]
- test.fail_test(not test.stderr() in errs)
elif sys.platform.find('sunos') != -1:
errs = [
- cannot_execute % ('sh: %s' % test.workdir, 'f3', 1),
+ cannot_execute % ('f3', 1),
]
- test.fail_test(not test.stderr() in errs)
else:
errs = [
- cannot_execute % (not_executable, 'f3', 126),
- is_a_directory % (test.workdir, 'f3', 126),
- Is_a_directory % (test.workdir, 'f3', 126),
- Permission_denied % (test.workdir, 'f3', 126),
+ cannot_execute % ('f3', 126),
+ is_a_directory % ('f3', 126),
+ permission_denied % ('f3', 126),
]
- test.must_contain_any_line(test.stderr(), errs)
+
+test.must_contain_any_line(test.stderr(), errs, find=TestSCons.search_re)
test.pass_test()
diff --git a/test/Errors/non-executable-file.py b/test/Errors/non-executable-file.py
index db7c88a6..e1b8f4ef 100644
--- a/test/Errors/non-executable-file.py
+++ b/test/Errors/non-executable-file.py
@@ -42,30 +42,31 @@ Bad command or file name
"""
unrecognized = """\
-'%s' is not recognized as an internal or external command,
+'.+' is not recognized as an internal or external command,
operable program or batch file.
-scons: *** [%s] Error 1
+scons: \*\*\* \[%s\] Error 1
"""
unspecified = """\
The name specified is not recognized as an
internal or external command, operable program or batch file.
-scons: *** [%s] Error 1
+scons: \*\*\* \[%s\] Error 1
"""
cannot_execute = """\
-%s: cannot execute
-scons: *** [%s] Error %s
+(sh: )*.+: cannot execute
+scons: \*\*\* \[%s\] Error %s
"""
-Permission_denied = """\
-%s: Permission denied
-scons: *** [%s] Error %s
+permission_denied = """\
+.+: (p|P)ermission denied
+scons: \*\*\* \[%s\] Error %s
"""
-permission_denied = """\
-%s: permission denied
-scons: *** [%s] Error %s
+konnte_nicht_gefunden_werden = """\
+Der Befehl ".+" ist entweder falsch geschrieben oder
+konnte nicht gefunden werden.
+scons: \*\*\* \[%s\] Error %s
"""
test.write('SConstruct', r"""
@@ -83,22 +84,21 @@ test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
if os.name == 'nt':
errs = [
bad_command,
- unrecognized % (not_executable, 'f1'),
+ unrecognized % 'f1',
+ konnte_nicht_gefunden_werden % ('f1', 1),
unspecified % 'f1'
]
- test.fail_test(not test.stderr() in errs)
elif sys.platform.find('sunos') != -1:
errs = [
- cannot_execute % ('sh: %s' % not_executable, 'f1', 1),
+ cannot_execute % ('f1', 1),
]
- test.fail_test(not test.stderr() in errs)
else:
errs = [
- cannot_execute % (not_executable, 'f1', 126),
- Permission_denied % (not_executable, 'f1', 126),
- permission_denied % (not_executable, 'f1', 126),
+ cannot_execute % ('f1', 126),
+ permission_denied % ('f1', 126),
]
- test.must_contain_any_line(test.stderr(), errs)
+
+test.must_contain_any_line(test.stderr(), errs, find=TestSCons.search_re)
test.pass_test()
diff --git a/test/Errors/nonexistent-executable.py b/test/Errors/nonexistent-executable.py
index b9deea12..acaaaeb1 100644
--- a/test/Errors/nonexistent-executable.py
+++ b/test/Errors/nonexistent-executable.py
@@ -46,58 +46,33 @@ test.run(arguments='.',
stderr = None,
status = 2)
-bad_command = """\
-Bad command or file name
-"""
-
-unrecognized = """\
-'%s' is not recognized as an internal or external command,
-operable program or batch file.
-scons: *** [%s] Error 1
-"""
-
-unspecified = """\
-The name specified is not recognized as an
-internal or external command, operable program or batch file.
-scons: *** [%s] Error 1
-"""
-
-not_found_1_space = """\
-sh: %s: not found
-scons: *** [%s] Error %s
-"""
-
-not_found_2_spaces = """\
-sh: %s: not found
-scons: *** [%s] Error %s
-"""
-
-No_such = """\
-%s: No such file or directory
-scons: *** [%s] Error %s
-"""
+bad_command = """Bad command or file name"""
+unrecognized = r"""'.+' is not recognized as an internal or external command,\s+operable program or batch file.\sscons: \*\*\* \[%s\] Error 1"""
+unspecified = r"""The name specified is not recognized as an\s+internal or external command, operable program or batch file.\s+scons: \*\*\* \[%s\] Error 1"""
+not_found_space = r"""sh: (\d: )*.+: \s*not found\s+scons: \*\*\* \[%s\] Error %s"""
+No_such = r""".+: No such file or directory\s+scons: \*\*\* \[%s\] Error %s"""
+konnte_nicht_gefunden_werden = r"""Der Befehl ".+" ist entweder falsch geschrieben oder\s+konnte nicht gefunden werden.\s+scons: \*\*\* \[%s\] Error %s"""
test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
if os.name == 'nt':
errs = [
bad_command,
- unrecognized % (no_such_file, 'f1'),
+ unrecognized % 'f1',
+ konnte_nicht_gefunden_werden % ('f1', 1),
unspecified % 'f1'
]
- test.fail_test(not test.stderr() in errs)
elif sys.platform.find('sunos') != -1:
errs = [
- not_found_1_space % (no_such_file, 'f1', 1),
+ not_found_space % ('f1', 1),
]
- test.fail_test(not test.stderr() in errs)
else:
errs = [
- not_found_1_space % (no_such_file, 'f1', 1),
- not_found_2_spaces % (no_such_file, 'f1', 1),
- not_found_1_space % (no_such_file, 'f1', 127),
- No_such % (no_such_file, 'f1', 127),
+ not_found_space % ('f1', 1),
+ not_found_space % ('f1', 127),
+ No_such % ('f1', 127),
]
- test.must_contain_any_line(test.stderr(), errs)
+
+test.must_contain_any_line(test.stderr(), errs, find=TestSCons.search_re)
test.pass_test()
diff --git a/test/Execute.py b/test/Execute.py
index 4caa4c47..2e534447 100644
--- a/test/Execute.py
+++ b/test/Execute.py
@@ -84,19 +84,17 @@ test.write('m.in', "m.in\n")
import sys
if sys.platform == 'win32':
- expect = """\
-scons: *** Error 1
-scons: *** Error 2
-scons: *** nonexistent.in/*.*: The system cannot find the path specified
-"""
+ expect = r"""scons: \*\*\* Error 1
+scons: \*\*\* Error 2
+scons: \*\*\* nonexistent.in/\*\.\*: (The system cannot find the path specified|Das System kann den angegebenen Pfad nicht finden)"""
else:
- expect = """\
-scons: *** Error 1
-scons: *** Error 2
-scons: *** nonexistent.in: No such file or directory
-"""
+ expect = r"""scons: \*\*\* Error 1
+scons: \*\*\* Error 2
+scons: \*\*\* nonexistent\.in: No such file or directory"""
+
+test.run(arguments = '.', stdout = None, stderr = None)
-test.run(arguments = '.', stderr=expect)
+test.must_contain_all_lines(test.stderr(), expect.splitlines(), find=TestSCons.search_re)
test.must_match('a.out', "a.in\n")
test.must_match('b.out', "b.in\n")
diff --git a/test/Install/Install.py b/test/Install/Install.py
index 29a8276b..adadfd96 100644
--- a/test/Install/Install.py
+++ b/test/Install/Install.py
@@ -136,6 +136,7 @@ f = open(f1_out, 'rb')
expect = [
"Permission denied",
"The process cannot access the file because it is being used by another process",
+ "Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird",
]
test.run(chdir = 'work', arguments = f1_out, stderr=None, status=2)
diff --git a/test/Interactive/shell.py b/test/Interactive/shell.py
index f4e89bd9..842a12e5 100644
--- a/test/Interactive/shell.py
+++ b/test/Interactive/shell.py
@@ -83,21 +83,21 @@ scons.send("build foo.out\n")
scons.send("\n")
if sys.platform == 'win32':
- no_such_error = "'no_such_command' is not recognized as an internal or external command,\noperable program or batch file."
+ no_such_error = r"('no_such_command' is not recognized as an internal or external command,\s+operable program or batch file\.|Der Befehl \"no_such_command\" ist entweder falsch geschrieben oder\s+konnte nicht gefunden werden\.)"
else:
no_such_error = 'scons: no_such_command: No such file or directory'
expect_stdout = """\
-scons>>> Copy("foo.out", "foo.in")
-Touch("1")
+scons>>> Copy\("foo.out", "foo.in"\)
+Touch\("1"\)
scons>>> hello from shell_command.py
-scons>>> !%(_python_)s %(_shell_command_py_)s
+scons>>> ![^"]+ ".*"
hello from shell_command.py
scons>>> hello from shell_command.py
-scons>>> shell %(_python_)s %(_shell_command_py_)s
+scons>>> shell [^"]+ ".*"
hello from shell_command.py
scons>>> hello from shell_command.py
-scons>>> sh %(_python_)s %(_shell_command_py_)s
+scons>>> sh [^"]+ ".*"
hello from shell_command.py
scons>>> %(no_such_error)s
scons>>> !no_such_command arg1 arg2
@@ -108,9 +108,9 @@ scons: `foo.out' is up to date.
scons>>>
""" % locals()
-test.finish(scons, stdout = expect_stdout)
-
+test.finish(scons, stdout = None)
+test.must_contain_all_lines(test.stdout(), expect_stdout.splitlines(), find=TestSCons.search_re)
test.pass_test()
diff --git a/test/Object.py b/test/Object.py
index 406c2c11..c07da46c 100644
--- a/test/Object.py
+++ b/test/Object.py
@@ -24,13 +24,9 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import sys
import TestSCons
-if sys.platform == 'win32':
- _obj = '.obj'
-else:
- _obj = '.o'
+_obj = TestSCons._obj
test = TestSCons.TestSCons()
diff --git a/test/Repository/StaticLibrary.py b/test/Repository/StaticLibrary.py
index e5c76f97..4f8160c5 100644
--- a/test/Repository/StaticLibrary.py
+++ b/test/Repository/StaticLibrary.py
@@ -25,17 +25,10 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
-import sys
import TestSCons
-if sys.platform == 'win32':
- _obj = '.obj'
- _exe = '.exe'
-else:
- _obj = '.o'
- _exe = ''
-
-
+_obj = TestSCons._obj
+_exe = TestSCons._exe
test = TestSCons.TestSCons()
diff --git a/test/scons-time/func/file.py b/test/scons-time/func/file.py
index fa9d36ee..8e121236 100644
--- a/test/scons-time/func/file.py
+++ b/test/scons-time/func/file.py
@@ -76,13 +76,13 @@ r"""set title "ST2.CONF TITLE"
set key bottom left
set label 3 "label 1.5" at 0.5,0.5 right
set label 4 "label 1.6" at 0.6,0.4 right
-plot '-' title "Startup" with lines lt 1, \
- '-' notitle with lines lt 7, \
- '-' title "label 1.5" with lines lt 7, \
+plot '-' title "Startup" with lines lt 1, \\
+ '-' notitle with lines lt 7, \\
+ '-' title "label 1.5" with lines lt 7, \\
'-' title "label 1.6" with lines lt 7
# Startup
1 0.000
-2 0.000
+2 0.\d*
e
1.4 0
1.4 1
@@ -95,8 +95,9 @@ e
e
"""
-test.run(arguments = 'func --file st2.conf --fmt gnuplot', stdout = expect2)
+test.run(arguments = 'func --file st2.conf --fmt gnuplot')
+test.must_contain_exactly_lines(test.stdout(), expect2, find=TestSCons_time.search_re_in_list)
test.pass_test()