diff options
author | Mats Wichmann <mats@linux.com> | 2019-03-01 16:46:54 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-03-01 17:10:38 (GMT) |
commit | 83c4b8ff692066bf29daa9a6aebf10818a914475 (patch) | |
tree | ec26b4b7a17b95aa512273f627d11f0093d6741d /test/runtest | |
parent | f765b5c4fa6b41de214b243daa6dd3ad6356dfe2 (diff) | |
download | SCons-83c4b8ff692066bf29daa9a6aebf10818a914475.zip SCons-83c4b8ff692066bf29daa9a6aebf10818a914475.tar.gz SCons-83c4b8ff692066bf29daa9a6aebf10818a914475.tar.bz2 |
[WIP] for #3304: drop use of -tt if py3
As noted in issue #3304, the Python flag to error on inconsistent
tabs/spaces has been dropped for Python 3 interpreters; while
CPython still accepts it, silently ignoring it, PyPy3 errors out.
This change adds the flag throughout the testsuite run only if
using a Python2 interpreter.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/runtest')
-rw-r--r-- | test/runtest/baseline/combined.py | 7 | ||||
-rw-r--r-- | test/runtest/baseline/fail.py | 3 | ||||
-rw-r--r-- | test/runtest/baseline/no_result.py | 3 | ||||
-rw-r--r-- | test/runtest/baseline/pass.py | 3 | ||||
-rw-r--r-- | test/runtest/fallback.py | 7 | ||||
-rw-r--r-- | test/runtest/noqmtest.py | 7 | ||||
-rw-r--r-- | test/runtest/print_time.py | 7 | ||||
-rw-r--r-- | test/runtest/python.py | 7 | ||||
-rw-r--r-- | test/runtest/simple/combined.py | 7 | ||||
-rw-r--r-- | test/runtest/simple/fail.py | 3 | ||||
-rw-r--r-- | test/runtest/simple/no_result.py | 3 | ||||
-rw-r--r-- | test/runtest/simple/pass.py | 3 | ||||
-rw-r--r-- | test/runtest/src.py | 5 | ||||
-rw-r--r-- | test/runtest/testargv.py | 5 | ||||
-rw-r--r-- | test/runtest/testlistfile.py | 3 | ||||
-rw-r--r-- | test/runtest/xml/output.py | 7 |
16 files changed, 50 insertions, 30 deletions
diff --git a/test/runtest/baseline/combined.py b/test/runtest/baseline/combined.py index 35c1796..228d42d 100644 --- a/test/runtest/baseline/combined.py +++ b/test/runtest/baseline/combined.py @@ -34,6 +34,7 @@ import os import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test_fail_py = os.path.join('test', 'fail.py') test_no_result_py = os.path.join('test', 'no_result.py') test_pass_py = os.path.join('test', 'pass.py') @@ -49,11 +50,11 @@ test.write_no_result_test(['test', 'no_result.py']) test.write_passing_test(['test', 'pass.py']) expect_stdout = """\ -%(pythonstring)s -tt %(test_fail_py)s +%(pythonstring)s%(pythonflags)s %(test_fail_py)s FAILING TEST STDOUT -%(pythonstring)s -tt %(test_no_result_py)s +%(pythonstring)s%(pythonflags)s %(test_no_result_py)s NO RESULT TEST STDOUT -%(pythonstring)s -tt %(test_pass_py)s +%(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT Failed the following test: diff --git a/test/runtest/baseline/fail.py b/test/runtest/baseline/fail.py index 5687160..e2aff4a 100644 --- a/test/runtest/baseline/fail.py +++ b/test/runtest/baseline/fail.py @@ -31,6 +31,7 @@ Test how we handle a failing test specified on the command line. import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test = TestRuntest.TestRuntest() @@ -39,7 +40,7 @@ test.subdir('test') test.write_failing_test(['test', 'fail.py']) expect_stdout = """\ -%(pythonstring)s -tt test/fail.py +%(pythonstring)s%(pythonflags)s test/fail.py FAILING TEST STDOUT """ % locals() diff --git a/test/runtest/baseline/no_result.py b/test/runtest/baseline/no_result.py index 2149594..b63d0c6 100644 --- a/test/runtest/baseline/no_result.py +++ b/test/runtest/baseline/no_result.py @@ -31,6 +31,7 @@ Test how we handle a no-results test specified on the command line. import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test = TestRuntest.TestRuntest() @@ -39,7 +40,7 @@ test.subdir('test') test.write_no_result_test(['test', 'no_result.py']) expect_stdout = """\ -%(pythonstring)s -tt test/no_result.py +%(pythonstring)s%(pythonflags)s test/no_result.py NO RESULT TEST STDOUT """ % locals() diff --git a/test/runtest/baseline/pass.py b/test/runtest/baseline/pass.py index affa486..481fc97 100644 --- a/test/runtest/baseline/pass.py +++ b/test/runtest/baseline/pass.py @@ -33,6 +33,7 @@ import os import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test_pass_py = os.path.join('test', 'pass.py') test = TestRuntest.TestRuntest() @@ -42,7 +43,7 @@ test.subdir('test') test.write_passing_test(['test', 'pass.py']) expect_stdout = """\ -%(pythonstring)s -tt %(test_pass_py)s +%(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT """ % locals() diff --git a/test/runtest/fallback.py b/test/runtest/fallback.py index 1229b28..b137307 100644 --- a/test/runtest/fallback.py +++ b/test/runtest/fallback.py @@ -34,6 +34,7 @@ import os import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test = TestRuntest.TestRuntest() @@ -56,11 +57,11 @@ test.write_no_result_test(test_no_result_py) test.write_passing_test(test_pass_py) expect_stdout = """\ -%(pythonstring)s -tt %(test_fail_py)s +%(pythonstring)s%(pythonflags)s %(test_fail_py)s FAILING TEST STDOUT -%(pythonstring)s -tt %(test_no_result_py)s +%(pythonstring)s%(pythonflags)s %(test_no_result_py)s NO RESULT TEST STDOUT -%(pythonstring)s -tt %(test_pass_py)s +%(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT Failed the following test: diff --git a/test/runtest/noqmtest.py b/test/runtest/noqmtest.py index cea2f11..fcf7ac0 100644 --- a/test/runtest/noqmtest.py +++ b/test/runtest/noqmtest.py @@ -34,6 +34,7 @@ import os import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test = TestRuntest.TestRuntest() @@ -48,11 +49,11 @@ test.write_no_result_test(test_no_result_py) test.write_passing_test(test_pass_py) expect_stdout = """\ -%(pythonstring)s -tt %(test_fail_py)s +%(pythonstring)s%(pythonflags)s %(test_fail_py)s FAILING TEST STDOUT -%(pythonstring)s -tt %(test_no_result_py)s +%(pythonstring)s%(pythonflags)s %(test_no_result_py)s NO RESULT TEST STDOUT -%(pythonstring)s -tt %(test_pass_py)s +%(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT Failed the following test: diff --git a/test/runtest/print_time.py b/test/runtest/print_time.py index 244c6f8..322b88b 100644 --- a/test/runtest/print_time.py +++ b/test/runtest/print_time.py @@ -36,6 +36,7 @@ import TestCmd import TestRuntest pythonstring = re.escape(TestRuntest.pythonstring) +pythonflags = TestRuntest.pythonflags 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')) @@ -51,13 +52,13 @@ test.write_no_result_test(['test', 'no_result.py']) test.write_passing_test(['test', 'pass.py']) expect_stdout = """\ -%(pythonstring)s -tt %(test_fail_py)s +%(pythonstring)s%(pythonflags)s %(test_fail_py)s FAILING TEST STDOUT Test execution time: \\d+.\\d seconds -%(pythonstring)s -tt %(test_no_result_py)s +%(pythonstring)s%(pythonflags)s %(test_no_result_py)s NO RESULT TEST STDOUT Test execution time: \\d+.\\d seconds -%(pythonstring)s -tt %(test_pass_py)s +%(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT Test execution time: \\d+.\\d seconds Total execution time for all tests: \\d+.\\d seconds diff --git a/test/runtest/python.py b/test/runtest/python.py index bcbc062..14156e0 100644 --- a/test/runtest/python.py +++ b/test/runtest/python.py @@ -43,6 +43,11 @@ test_pass_py = os.path.join('test', 'pass.py') head, python = os.path.split(TestRuntest.python) head, dir = os.path.split(head) +# deciding whether or not to use -tt flag here is dicey. +# we'll go ahead and use TestRuntest.pythonflags, but it uses the +# python version then in use, which could be different +pythonflags = TestRuntest.pythonflags + # We have to normalize the python path here, because some installations don't like # getting called with "/bin/../bin/python" as first argument, e.g. Fedora 17 Desktop. mypython = os.path.normpath(os.path.join(head, dir, os.path.pardir, dir, python)) @@ -60,7 +65,7 @@ test.subdir('test') test.write_passing_test(['test', 'pass.py']) expect_stdout = """\ -%(mypythonstring)s -tt %(test_pass_py)s +%(mypythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT """ % locals() diff --git a/test/runtest/simple/combined.py b/test/runtest/simple/combined.py index 616f4d5..ec0a1bb 100644 --- a/test/runtest/simple/combined.py +++ b/test/runtest/simple/combined.py @@ -37,6 +37,7 @@ import TestRuntest test = TestRuntest.TestRuntest() pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test_fail_py = os.path.join('test', 'fail.py') test_no_result_py = os.path.join('test', 'no_result.py') test_pass_py = os.path.join('test', 'pass.py') @@ -50,11 +51,11 @@ test.write_no_result_test(['test', 'no_result.py']) test.write_passing_test(['test', 'pass.py']) expect_stdout = """\ -%(pythonstring)s -tt %(test_fail_py)s +%(pythonstring)s%(pythonflags)s %(test_fail_py)s FAILING TEST STDOUT -%(pythonstring)s -tt %(test_no_result_py)s +%(pythonstring)s%(pythonflags)s %(test_no_result_py)s NO RESULT TEST STDOUT -%(pythonstring)s -tt %(test_pass_py)s +%(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT Failed the following test: diff --git a/test/runtest/simple/fail.py b/test/runtest/simple/fail.py index 8b800fb..f26f00e 100644 --- a/test/runtest/simple/fail.py +++ b/test/runtest/simple/fail.py @@ -31,6 +31,7 @@ Test how we handle a failing test specified on the command line. import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test = TestRuntest.TestRuntest() @@ -39,7 +40,7 @@ test.subdir('test') test.write_failing_test(['test', 'fail.py']) expect_stdout = """\ -%(pythonstring)s -tt test/fail.py +%(pythonstring)s%(pythonflags)s test/fail.py FAILING TEST STDOUT """ % locals() diff --git a/test/runtest/simple/no_result.py b/test/runtest/simple/no_result.py index 91af7e4..2fd40b4 100644 --- a/test/runtest/simple/no_result.py +++ b/test/runtest/simple/no_result.py @@ -31,6 +31,7 @@ Test how we handle a no-results test specified on the command line. import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test = TestRuntest.TestRuntest() @@ -39,7 +40,7 @@ test.subdir('test') test.write_no_result_test(['test', 'no_result.py']) expect_stdout = """\ -%(pythonstring)s -tt test/no_result.py +%(pythonstring)s%(pythonflags)s test/no_result.py NO RESULT TEST STDOUT """ % locals() diff --git a/test/runtest/simple/pass.py b/test/runtest/simple/pass.py index 6e5b6b0..7ceb9a0 100644 --- a/test/runtest/simple/pass.py +++ b/test/runtest/simple/pass.py @@ -31,6 +31,7 @@ Test how we handle a passing test specified on the command line. import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test = TestRuntest.TestRuntest() @@ -39,7 +40,7 @@ test.subdir('test') test.write_passing_test(['test', 'pass.py']) expect_stdout = """\ -%(pythonstring)s -tt test/pass.py +%(pythonstring)s%(pythonflags)s test/pass.py PASSING TEST STDOUT """ % locals() diff --git a/test/runtest/src.py b/test/runtest/src.py index 23894f9..cbce2bd 100644 --- a/test/runtest/src.py +++ b/test/runtest/src.py @@ -39,6 +39,7 @@ test.subdir(['src'], ['src', 'suite']) pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags src_passTests_py = os.path.join('src', 'passTests.py') src_suite_passTests_py = os.path.join('src', 'suite', 'passTests.py') @@ -51,9 +52,9 @@ test.write_passing_test(['src', 'suite', 'pass.py']) test.write_passing_test(['src', 'suite', 'passTests.py']) expect_stdout = """\ -%(pythonstring)s -tt %(src_passTests_py)s +%(pythonstring)s%(pythonflags)s %(src_passTests_py)s PASSING TEST STDOUT -%(pythonstring)s -tt %(src_suite_passTests_py)s +%(pythonstring)s%(pythonflags)s %(src_suite_passTests_py)s PASSING TEST STDOUT """ % locals() diff --git a/test/runtest/testargv.py b/test/runtest/testargv.py index 62faf51..22e57e8 100644 --- a/test/runtest/testargv.py +++ b/test/runtest/testargv.py @@ -40,6 +40,7 @@ test.subdir('test', ['test', 'subdir']) files = {} files['pythonstring'] = TestRuntest.pythonstring +files['pythonflags'] = TestRuntest.pythonflags files['one'] = os.path.join('test/subdir', 'test_one.py') files['two'] = os.path.join('test/subdir', 'two.py') @@ -50,9 +51,9 @@ test.write_passing_test(files['two']) test.write_passing_test(files['three']) expect_stdout = """\ -%(pythonstring)s -tt %(one)s +%(pythonstring)s%(pythonflags)s %(one)s PASSING TEST STDOUT -%(pythonstring)s -tt %(two)s +%(pythonstring)s%(pythonflags)s %(two)s PASSING TEST STDOUT """ % files diff --git a/test/runtest/testlistfile.py b/test/runtest/testlistfile.py index b86b0f2..063a8d0 100644 --- a/test/runtest/testlistfile.py +++ b/test/runtest/testlistfile.py @@ -34,6 +34,7 @@ import re import TestRuntest pythonstring = TestRuntest.pythonstring +pythonflags = TestRuntest.pythonflags test_fail_py = os.path.join('test', 'fail.py') test_no_result_py = os.path.join('test', 'no_result.py') test_pass_py = os.path.join('test', 'pass.py') @@ -54,7 +55,7 @@ test.write('t.txt', """\ """ % locals()) expect_stdout = """\ -%(pythonstring)s -tt %(test_pass_py)s +%(pythonstring)s%(pythonflags)s %(test_pass_py)s PASSING TEST STDOUT """ % locals() diff --git a/test/runtest/xml/output.py b/test/runtest/xml/output.py index e669a3a..88bca04 100644 --- a/test/runtest/xml/output.py +++ b/test/runtest/xml/output.py @@ -38,6 +38,7 @@ test = TestRuntest.TestRuntest(match = TestCmd.match_re, diff = TestCmd.diff_re) pythonstring = re.escape(TestRuntest.pythonstring) +pythonflags = TestRuntest.pythonflags 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')) @@ -58,7 +59,7 @@ expect = """\ <results> <test> <file_name>%(test_fail_py)s</file_name> - <command_line>%(pythonstring)s -tt %(test_fail_py)s</command_line> + <command_line>%(pythonstring)s%(pythonflags)s %(test_fail_py)s</command_line> <exit_status>1</exit_status> <stdout>FAILING TEST STDOUT </stdout> @@ -68,7 +69,7 @@ expect = """\ </test> <test> <file_name>%(test_no_result_py)s</file_name> - <command_line>%(pythonstring)s -tt %(test_no_result_py)s</command_line> + <command_line>%(pythonstring)s%(pythonflags)s %(test_no_result_py)s</command_line> <exit_status>2</exit_status> <stdout>NO RESULT TEST STDOUT </stdout> @@ -78,7 +79,7 @@ expect = """\ </test> <test> <file_name>%(test_pass_py)s</file_name> - <command_line>%(pythonstring)s -tt %(test_pass_py)s</command_line> + <command_line>%(pythonstring)s%(pythonflags)s %(test_pass_py)s</command_line> <exit_status>0</exit_status> <stdout>PASSING TEST STDOUT </stdout> |