summaryrefslogtreecommitdiffstats
path: root/runtest.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-04-19 01:06:11 (GMT)
committerSteven Knight <knight@baldmt.com>2010-04-19 01:06:11 (GMT)
commitc0079cc5ace115fa5456fad81ec83242c5203926 (patch)
tree96f2869ce9e8c6ba9ab89d979c88484ec20d5fc7 /runtest.py
parentae1e7c742dcd1ed0b521640455794172fe275c65 (diff)
downloadSCons-c0079cc5ace115fa5456fad81ec83242c5203926.zip
SCons-c0079cc5ace115fa5456fad81ec83242c5203926.tar.gz
SCons-c0079cc5ace115fa5456fad81ec83242c5203926.tar.bz2
Add a -3 option to print Python 3.x incompatibility warnings during tests.
Diffstat (limited to 'runtest.py')
-rw-r--r--runtest.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/runtest.py b/runtest.py
index 031a1f6..d00d56e 100644
--- a/runtest.py
+++ b/runtest.py
@@ -24,6 +24,8 @@
#
# Options:
#
+# -3 Run with the python -3 option,
+#
# -a Run all tests; does a virtual 'find' for
# all SCons tests under the current directory.
#
@@ -142,6 +144,7 @@ list_only = None
printcommand = 1
package = None
print_passed_summary = None
+python3incompatibilities = None
scons = None
scons_exec = None
outputfile = None
@@ -155,6 +158,7 @@ spe = None
helpstr = """\
Usage: runtest.py [OPTIONS] [TEST ...]
Options:
+ -3 Warn about Python 3.x incompatibilities.
-a, --all Run all tests.
--aegis Print results in Aegis format.
-b BASE, --baseline BASE Run test scripts against baseline BASE.
@@ -192,7 +196,7 @@ Options:
--xml Print results in SCons XML format.
"""
-opts, args = getopt.getopt(sys.argv[1:], "ab:df:hlno:P:p:qv:Xx:t",
+opts, args = getopt.getopt(sys.argv[1:], "3ab:df:hlno:P:p:qv:Xx:t",
['all', 'aegis', 'baseline=', 'builddir=',
'debug', 'file=', 'help',
'list', 'no-exec', 'noqmtest', 'output=',
@@ -202,7 +206,9 @@ opts, args = getopt.getopt(sys.argv[1:], "ab:df:hlno:P:p:qv:Xx:t",
'verbose=', 'xml'])
for o, a in opts:
- if o in ['-a', '--all']:
+ if o in ['-3']:
+ python3incompatibilities = 1
+ elif o in ['-a', '--all']:
all = 1
elif o in ['-b', '--baseline']:
baseline = a
@@ -610,6 +616,9 @@ if old_pythonpath:
os.pathsep + \
old_pythonpath
+if python3incompatibilities:
+ os.environ['SCONS_HORRIBLE_REGRESSION_TEST_HACK'] = '1'
+
tests = []
def find_Tests_py(directory):
@@ -792,6 +801,8 @@ else:
total_start_time = time_func()
for t in tests:
command_args = ['-tt']
+ if python3incompatibilities:
+ command_args.append('-3')
if debug:
command_args.append(debug)
command_args.append(t.path)