Steven checked in some changes yesterday which fixed a great number of
authorbdbaddog <bdbaddog@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 15 Sep 2009 01:37:39 +0000 (01:37 +0000)
committerbdbaddog <bdbaddog@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 15 Sep 2009 01:37:39 +0000 (01:37 +0000)
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.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@4361 fdb21ef1-2011-0410-befe-b5e4ea1792b1

QMTest/TestSCons.py
test/SCONSFLAGS.py
test/python-version.py

index b4e910a4c1df034cb6ec4fa38f8b484f5051dcdf..f50f6aaf48789281bea778d7296008a263cf2a8a 100644 (file)
@@ -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:
index 387cb264f5ccb008833dba4887513c7df3bf3d18..cd3631335328a26b065860f725b4049426120efd 100644 (file)
@@ -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()
 
index fbebf8da0fb9e9ee3a1799e454c13f1a1eab6318..8230fd3b588941efb5005820a34d49c9ff05cb16 100644 (file)
@@ -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: