diff options
Diffstat (limited to 'test/MSVS/vs-7.0-files.py')
-rw-r--r-- | test/MSVS/vs-7.0-files.py | 88 |
1 files changed, 21 insertions, 67 deletions
diff --git a/test/MSVS/vs-7.0-files.py b/test/MSVS/vs-7.0-files.py index c8134e9..d20b298 100644 --- a/test/MSVS/vs-7.0-files.py +++ b/test/MSVS/vs-7.0-files.py @@ -30,8 +30,6 @@ solution (.sln) files that look correct. """ import os -import os.path -import sys import TestSConsMSVS @@ -48,38 +46,36 @@ SConscript_contents = TestSConsMSVS.SConscript_contents_7_0 -test.subdir('work1') +test.write('SConstruct', SConscript_contents) -test.write(['work1', 'SConstruct'], SConscript_contents) +test.run(arguments="Test.vcproj") -test.run(chdir='work1', arguments="Test.vcproj") - -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') +test.must_exist(test.workpath('Test.vcproj')) +vcproj = test.read('Test.vcproj', 'r') +expect = test.msvs_substitute(expected_vcprojfile, '7.0', None, 'SConstruct') # don't compare the pickled data assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) -test.must_exist(test.workpath('work1', 'Test.sln')) -sln = test.read(['work1', 'Test.sln'], 'r') -expect = test.msvs_substitute(expected_slnfile, '7.0', 'work1', 'SConstruct') +test.must_exist(test.workpath('Test.sln')) +sln = test.read('Test.sln', 'r') +expect = test.msvs_substitute(expected_slnfile, '7.0', None, 'SConstruct') # don't compare the pickled data assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) -test.run(chdir='work1', arguments='-c .') +test.run(arguments='-c .') -test.must_not_exist(test.workpath('work1', 'Test.vcproj')) -test.must_not_exist(test.workpath('work1', 'Test.sln')) +test.must_not_exist(test.workpath('Test.vcproj')) +test.must_not_exist(test.workpath('Test.sln')) -test.run(chdir='work1', arguments='Test.vcproj') +test.run(arguments='Test.vcproj') -test.must_exist(test.workpath('work1', 'Test.vcproj')) -test.must_exist(test.workpath('work1', 'Test.sln')) +test.must_exist(test.workpath('Test.vcproj')) +test.must_exist(test.workpath('Test.sln')) -test.run(chdir='work1', arguments='-c Test.sln') +test.run(arguments='-c Test.sln') -test.must_not_exist(test.workpath('work1', 'Test.vcproj')) -test.must_not_exist(test.workpath('work1', 'Test.sln')) +test.must_not_exist(test.workpath('Test.vcproj')) +test.must_not_exist(test.workpath('Test.sln')) @@ -88,57 +84,15 @@ test.must_not_exist(test.workpath('work1', 'Test.sln')) os.environ['PYTHON_ROOT'] = 'xyzzy' python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) -test.run(chdir='work1', arguments='Test.vcproj') - -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', - python=python) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -del os.environ['PYTHON_ROOT'] -python = None - - +test.run(arguments='Test.vcproj') -test.subdir('work2', ['work2', 'src']) - -test.write(['work2', 'SConstruct'], """\ -SConscript('src/SConscript', variant_dir='build') -""") - -test.write(['work2', 'src', 'SConscript'], SConscript_contents) - -test.run(chdir='work2', arguments=".") - -vcproj = test.read(['work2', 'src', 'Test.vcproj'], 'r') -expect = test.msvs_substitute(expected_vcprojfile, '7.0', 'work2', 'SConstruct', +test.must_exist(test.workpath('Test.vcproj')) +vcproj = test.read('Test.vcproj', 'r') +expect = test.msvs_substitute(expected_vcprojfile, '7.0', None, 'SConstruct', python=python) # don't compare the pickled data assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) -test.must_exist(test.workpath('work2', 'src', 'Test.sln')) -sln = test.read(['work2', 'src', 'Test.sln'], 'r') -expect = test.msvs_substitute(expected_slnfile, '7.0', - os.path.join('work2', 'src')) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.must_match(['work2', 'build', 'Test.vcproj'], """\ -This is just a placeholder file. -The real project file is here: -%s -""" % test.workpath('work2', 'src', 'Test.vcproj'), - mode='r') - -test.must_match(['work2', 'build', 'Test.sln'], """\ -This is just a placeholder file. -The real workspace file is here: -%s -""" % test.workpath('work2', 'src', 'Test.sln'), - mode='r') - test.pass_test() |