Win32 portability in runtest.py tests after disabling QMTest by default.
[scons.git] / test / runtest / print_time.py
index 1d86baad5191fca4ebc9a5595139a4a21799404f..e0684475f221b070e88a498d26b7fcdf004895e0 100644 (file)
@@ -29,9 +29,17 @@ Test a combination of a passing test, failing test, and no-result
 test with no argument on the command line.
 """
 
+import os
+import re
+
 import TestCmd
 import TestRuntest
 
+pythonstring = re.escape(TestRuntest.pythonstring)
+test_fail_py = re.escape(os.path.join('test', 'fail.py'))
+test_no_result_py = re.escape(os.path.join('test', 'no_result.py'))
+test_pass_py = re.escape(os.path.join('test', 'pass.py'))
+
 test = TestRuntest.TestRuntest(match = TestCmd.match_re)
 
 test.subdir('test')
@@ -42,48 +50,40 @@ test.write_no_result_test(['test', 'no_result.py'])
 
 test.write_passing_test(['test', 'pass.py'])
 
-# NOTE:  The "test/fail.py : FAIL" and "test/pass.py : PASS" lines both
-# have spaces at the end.
-
-expect = r"""qmtest.py run --output results.qmr --format none --result-stream=scons_tdb.AegisChangeStream --context print_time=1 test
---- TEST RESULTS -------------------------------------------------------------
-
-  test/fail.py                                  : FAIL    
-
-    FAILING TEST STDOUT
-
-    FAILING TEST STDERR
-
-    Total execution time: \d+\.\d+ seconds
-
-  test/no_result.py                             : NO_RESULT
-
-    NO RESULT TEST STDOUT
-
-    NO RESULT TEST STDERR
-
-    Total execution time: \d+\.\d+ seconds
-
-  test/pass.py                                  : PASS    
-
-    Total execution time: \d+\.\d+ seconds
-
---- TESTS THAT DID NOT PASS --------------------------------------------------
-
-  test/fail.py                                  : FAIL    
-
-  test/no_result.py                             : NO_RESULT
-
-
---- STATISTICS ---------------------------------------------------------------
-
-       3        tests total
-
-       1 \( 33%\) tests PASS
-       1 \( 33%\) tests FAIL
-       1 \( 33%\) tests NO_RESULT
+expect_stdout = """\
+%(pythonstring)s -tt %(test_fail_py)s
+FAILING TEST STDOUT
+Test execution time: \\d+.\\d seconds
+%(pythonstring)s -tt %(test_no_result_py)s
+NO RESULT TEST STDOUT
+Test execution time: \\d+.\\d seconds
+%(pythonstring)s -tt %(test_pass_py)s
+PASSING TEST STDOUT
+Test execution time: \\d+.\\d seconds
+Total execution time for all tests: \\d+.\\d seconds
+
+Failed the following test:
+\t%(test_fail_py)s
+
+NO RESULT from the following test:
+\t%(test_no_result_py)s
+""" % locals()
+
+expect_stderr = """\
+FAILING TEST STDERR
+NO RESULT TEST STDERR
+PASSING TEST STDERR
 """
 
-test.run(arguments = '--qmtest -t test', stdout = expect)
+test.run(arguments='-t test',
+         status=1,
+         stdout=expect_stdout,
+         stderr=expect_stderr)
 
 test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: