diff options
Diffstat (limited to 'test/runtest/print_time.py')
-rw-r--r-- | test/runtest/print_time.py | 69 |
1 files changed, 28 insertions, 41 deletions
diff --git a/test/runtest/print_time.py b/test/runtest/print_time.py index 38a5bc6..54f90fe 100644 --- a/test/runtest/print_time.py +++ b/test/runtest/print_time.py @@ -35,6 +35,7 @@ import re import TestCmd import TestRuntest +python = TestRuntest.python 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')) @@ -49,49 +50,35 @@ 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 run --output results.qmr --format none --result-stream="scons_tdb.AegisChangeStream\(print_time='1'\)" test ---- TEST RESULTS ------------------------------------------------------------- - - %(test_fail_py)s : FAIL - - FAILING TEST STDOUT - - FAILING TEST STDERR - - Total execution time: \d+\.\d+ seconds - - %(test_no_result_py)s : NO_RESULT - - NO RESULT TEST STDOUT - - NO RESULT TEST STDERR - - Total execution time: \d+\.\d+ seconds - - %(test_pass_py)s : PASS - - Total execution time: \d+\.\d+ seconds - ---- TESTS THAT DID NOT PASS -------------------------------------------------- - - %(test_fail_py)s : FAIL - - %(test_no_result_py)s : NO_RESULT - - ---- STATISTICS --------------------------------------------------------------- - - 3 tests total - - 1 \( 33%%\) tests PASS - 1 \( 33%%\) tests FAIL - 1 \( 33%%\) tests NO_RESULT +expect_stdout = """\ +%(python)s -tt test/fail.py +FAILING TEST STDOUT +Test execution time: \\d+.\\d seconds +%(python)s -tt test/no_result.py +NO RESULT TEST STDOUT +Test execution time: \\d+.\\d seconds +%(python)s -tt test/pass.py +PASSING TEST STDOUT +Test execution time: \\d+.\\d seconds +Total execution time for all tests: \\d+.\\d seconds + +Failed the following test: +\ttest/fail.py + +NO RESULT from the following test: +\ttest/no_result.py """ % locals() -test.run(arguments = '-t test', status = 1, stdout = expect) +expect_stderr = """\ +FAILING TEST STDERR +NO RESULT TEST STDERR +PASSING TEST STDERR +""" + +test.run(arguments='-t test', + status=1, + stdout=expect_stdout, + stderr=expect_stderr) test.pass_test() |