summaryrefslogtreecommitdiffstats
path: root/test/MSVS/vs-7.0-files.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-09-24 12:28:10 (GMT)
committerSteven Knight <knight@baldmt.com>2008-09-24 12:28:10 (GMT)
commit2acc329d8522dbaadece2c61744cf99019747239 (patch)
tree872054f8841e707d8dda4646463d742f5139fbb2 /test/MSVS/vs-7.0-files.py
parentaf3c530b230be367f9d785598bf85e04f293cadd (diff)
downloadSCons-2acc329d8522dbaadece2c61744cf99019747239.zip
SCons-2acc329d8522dbaadece2c61744cf99019747239.tar.gz
SCons-2acc329d8522dbaadece2c61744cf99019747239.tar.bz2
Split the MSVS variant_dir sub-tests into separate test scripts.
Diffstat (limited to 'test/MSVS/vs-7.0-files.py')
-rw-r--r--test/MSVS/vs-7.0-files.py88
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()