summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2009-09-15 01:37:39 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2009-09-15 01:37:39 (GMT)
commit499aa4440df6a3180c2890311ac53cc1e4cfc797 (patch)
tree547bc4eb042148c01f3e808921d12e8ac407cb5a
parent64c7e4aca167a3662bf98a4a39c8d489a87d4451 (diff)
downloadSCons-499aa4440df6a3180c2890311ac53cc1e4cfc797.zip
SCons-499aa4440df6a3180c2890311ac53cc1e4cfc797.tar.gz
SCons-499aa4440df6a3180c2890311ac53cc1e4cfc797.tar.bz2
Steven checked in some changes yesterday which fixed a great number of
failing tests by setting SCONSFLAGS='-warn=no-python-version' in def run() in TestSCons.py yesterday, where previously it was done in def __init__(...). This fixed most of the broken tests, but broke some of the working tests. I readded the logic to def __init__ In addition I've added an extra arg to the __init__ for TestSCons.py ignore_python_version (which defaults to true). For those tests which need to be able to see the deprecation and/or test the functionality of the deprecation.
-rw-r--r--QMTest/TestSCons.py15
-rw-r--r--test/SCONSFLAGS.py2
-rw-r--r--test/python-version.py7
3 files changed, 16 insertions, 8 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index b4e910a..f50f6aa 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -244,6 +244,19 @@ class TestSCons(TestCommon):
# control character output on FC8
# TERM can cause test failures due to control chars in prompts etc.
os.environ['TERM'] = 'dumb'
+
+ self.ignore_python_version=kw.get('ignore_python_version',1)
+ if kw.get('ignore_python_version',-1) != -1:
+ del kw['ignore_python_version']
+
+ if self.ignore_python_version and deprecated_python_version():
+ sconsflags = os.environ.get('SCONSFLAGS')
+ if sconsflags:
+ sconsflags = [sconsflags]
+ else:
+ sconsflags = []
+ sconsflags = sconsflags + ['--warn=no-python-version']
+ os.environ['SCONSFLAGS'] = string.join(sconsflags)
apply(TestCommon.__init__, [self], kw)
@@ -339,7 +352,7 @@ class TestSCons(TestCommon):
deprecation warnings.
"""
save_sconsflags = os.environ.get('SCONSFLAGS')
- if deprecated_python_version():
+ if self.ignore_python_version and deprecated_python_version():
if save_sconsflags:
sconsflags = [save_sconsflags]
else:
diff --git a/test/SCONSFLAGS.py b/test/SCONSFLAGS.py
index 387cb26..cd36313 100644
--- a/test/SCONSFLAGS.py
+++ b/test/SCONSFLAGS.py
@@ -29,7 +29,7 @@ import os
import TestCmd
import TestSCons
-test = TestSCons.TestSCons(match = TestCmd.match_re_dotall)
+test = TestSCons.TestSCons(match = TestCmd.match_re_dotall,ignore_python_version=0)
wpath = test.workpath()
diff --git a/test/python-version.py b/test/python-version.py
index fbebf8d..8230fd3 100644
--- a/test/python-version.py
+++ b/test/python-version.py
@@ -36,7 +36,7 @@ import string
import TestCmd
import TestSCons
-test = TestSCons.TestSCons(match = TestCmd.match_re_dotall)
+test = TestSCons.TestSCons(match = TestCmd.match_re_dotall,ignore_python_version=0)
test.write('SConstruct', "\n")
@@ -54,11 +54,6 @@ else:
if TestSCons.deprecated_python_version():
- sconsflags = os.environ.get('SCONSFLAGS')
- if sconsflags:
- sconsflags = string.replace(sconsflags, '--warn=no-python-version', '')
- os.environ['SCONSFLAGS'] = sconsflags
-
test.run(arguments = '-Q', stderr = TestSCons.deprecated_python_expr)
else: