diff options
Diffstat (limited to 'test/runtest/print_time.py')
-rw-r--r-- | test/runtest/print_time.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/test/runtest/print_time.py b/test/runtest/print_time.py index 1d86baa..39bf810 100644 --- a/test/runtest/print_time.py +++ b/test/runtest/print_time.py @@ -29,9 +29,16 @@ Test a combination of a passing test, failing test, and no-result test with no argument on the command line. """ +import os.path +import re + import TestCmd import TestRuntest +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') @@ -45,10 +52,10 @@ 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 +expect = r"""qmtest.py run --output results.qmr --format none --result-stream="scons_tdb.AegisChangeStream\(print_time='1'\)" test --- TEST RESULTS ------------------------------------------------------------- - test/fail.py : FAIL + %(test_fail_py)s : FAIL FAILING TEST STDOUT @@ -56,7 +63,7 @@ expect = r"""qmtest.py run --output results.qmr --format none --result-stream=sc Total execution time: \d+\.\d+ seconds - test/no_result.py : NO_RESULT + %(test_no_result_py)s : NO_RESULT NO RESULT TEST STDOUT @@ -64,26 +71,26 @@ expect = r"""qmtest.py run --output results.qmr --format none --result-stream=sc Total execution time: \d+\.\d+ seconds - test/pass.py : PASS + %(test_pass_py)s : PASS Total execution time: \d+\.\d+ seconds --- TESTS THAT DID NOT PASS -------------------------------------------------- - test/fail.py : FAIL + %(test_fail_py)s : FAIL - test/no_result.py : NO_RESULT + %(test_no_result_py)s : NO_RESULT --- STATISTICS --------------------------------------------------------------- 3 tests total - 1 \( 33%\) tests PASS - 1 \( 33%\) tests FAIL - 1 \( 33%\) tests NO_RESULT -""" + 1 \( 33%%\) tests PASS + 1 \( 33%%\) tests FAIL + 1 \( 33%%\) tests NO_RESULT +""" % locals() -test.run(arguments = '--qmtest -t test', stdout = expect) +test.run(arguments = '-t test', status = 1, stdout = expect) test.pass_test() |