From: stevenknight Date: Sat, 20 Sep 2008 13:41:57 +0000 (+0000) Subject: Windows test fix: enhance the TestSCons class so an explicit X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b13f5c56484104bf979ffdbb260d647ccd598d72;p=scons.git Windows test fix: enhance the TestSCons class so an explicit 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 --- diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index e14f8f4d..2ef393c4 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -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}" diff --git a/test/MSVS/vs-7.0-files.py b/test/MSVS/vs-7.0-files.py index 25355149..f00de517 100644 --- a/test/MSVS/vs-7.0-files.py +++ b/test/MSVS/vs-7.0-files.py @@ -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 diff --git a/test/MSVS/vs-7.1-files.py b/test/MSVS/vs-7.1-files.py index 578943d6..8c9821c8 100644 --- a/test/MSVS/vs-7.1-files.py +++ b/test/MSVS/vs-7.1-files.py @@ -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 diff --git a/test/MSVS/vs-8.0-files.py b/test/MSVS/vs-8.0-files.py index 33eefd56..40daa57f 100644 --- a/test/MSVS/vs-8.0-files.py +++ b/test/MSVS/vs-8.0-files.py @@ -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