Windows test fix: enhance the TestSCons class so an explicit
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 20 Sep 2008 13:41:57 +0000 (13:41 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 20 Sep 2008 13:41:57 +0000 (13:41 +0000)
python=None argument still defaults to sys.executable.  Use this to
reset the python value we interpolate into the expected files that we
generate after resetting the os.environ['PYTHON'] value.

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

QMTest/TestSCons.py
test/MSVS/vs-7.0-files.py
test/MSVS/vs-7.1-files.py
test/MSVS/vs-8.0-files.py

index e14f8f4dad6e51607e0dc3ca03618feb4a800487..2ef393c42c3716f6abce2d36f0160e054e2c2817 100644 (file)
@@ -757,7 +757,7 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS'])
 
     def msvs_substitute(self, input, msvs_ver,
                         subdir=None, sconscript=None,
-                        python=sys.executable,
+                        python=None,
                         project_guid=None):
         if not hasattr(self, '_msvs_versions'):
             self.msvs_versions()
@@ -770,6 +770,9 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS'])
         if sconscript is None:
             sconscript = self.workpath('SConstruct')
 
+        if python is None:
+            python = sys.executable
+
         if project_guid is None:
             project_guid = "{E5466E26-0003-F18B-8F8A-BCD76C86388D}"
 
index 253551492f25a614cf96dfcbe9094b8ddaeec795..f00de517a61fd15f845c672c0d6d302523f540e3 100644 (file)
@@ -203,11 +203,10 @@ test.must_not_exist(test.workpath('work1', 'Test.sln'))
 # Test that running SCons with $PYTHON_ROOT in the environment
 # changes the .vcproj output as expected.
 os.environ['PYTHON_ROOT'] = 'xyzzy'
+python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
 
 test.run(chdir='work1', arguments='Test.vcproj')
 
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
-
 test.must_exist(test.workpath('work1', 'Test.vcproj'))
 vcproj = test.read(['work1', 'Test.vcproj'], 'r')
 expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work1', 'SConstruct',
@@ -216,6 +215,7 @@ expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work1', 'SConstruct',
 assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
 
 os.environ['PYTHON_ROOT'] = ''
+python = None
 
 
 
index 578943d67703695c6e2a045b1a6e0b7087e4bc6e..8c9821c81f42d4bdfdfa59d6189dbe247fb8f5a9 100644 (file)
@@ -205,11 +205,10 @@ test.must_not_exist(test.workpath('work1', 'Test.sln'))
 # Test that running SCons with $PYTHON_ROOT in the environment
 # changes the .vcproj output as expected.
 os.environ['PYTHON_ROOT'] = 'xyzzy'
+python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
 
 test.run(chdir='work1', arguments='Test.vcproj')
 
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
-
 test.must_exist(test.workpath('work1', 'Test.vcproj'))
 vcproj = test.read(['work1', 'Test.vcproj'], 'r')
 expect = test.msvs_substitute(expected_vcprojfile, '7.1', 'work1', 'SConstruct',
@@ -218,6 +217,7 @@ expect = test.msvs_substitute(expected_vcprojfile, '7.1', 'work1', 'SConstruct',
 assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
 
 os.environ['PYTHON_ROOT'] = ''
+python = None
 
 
 
index 33eefd56f6f2092442d533219965365f84c378c7..40daa57fa6b04bf545bbeb5fb16b44561752c311 100644 (file)
@@ -212,11 +212,10 @@ test.must_not_exist(test.workpath('work1', 'Test.sln'))
 # Test that running SCons with $PYTHON_ROOT in the environment
 # changes the .vcproj output as expected.
 os.environ['PYTHON_ROOT'] = 'xyzzy'
+python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
 
 test.run(chdir='work1', arguments='Test.vcproj')
 
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSCons.python)[1])
-
 test.must_exist(test.workpath('work1', 'Test.vcproj'))
 vcproj = test.read(['work1', 'Test.vcproj'], 'r')
 expect = test.msvs_substitute(expected_vcprojfile, '8.0', 'work1', 'SConstruct',
@@ -225,6 +224,7 @@ expect = test.msvs_substitute(expected_vcprojfile, '8.0', 'work1', 'SConstruct',
 assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
 
 os.environ['PYTHON_ROOT'] = ''
+python = None