summaryrefslogtreecommitdiffstats
path: root/test/MSVS
diff options
context:
space:
mode:
Diffstat (limited to 'test/MSVS')
-rw-r--r--test/MSVS/common-prefix.py82
-rw-r--r--test/MSVS/runfile.py2
-rw-r--r--test/MSVS/vs-6.0-files.py4
-rw-r--r--test/MSVS/vs-7.0-files.py6
-rw-r--r--test/MSVS/vs-7.1-files.py6
-rw-r--r--test/MSVS/vs-8.0-files.py6
6 files changed, 75 insertions, 31 deletions
diff --git a/test/MSVS/common-prefix.py b/test/MSVS/common-prefix.py
index 6f508c9..d40060c 100644
--- a/test/MSVS/common-prefix.py
+++ b/test/MSVS/common-prefix.py
@@ -43,7 +43,7 @@ if sys.platform != 'win32':
msg = "Skipping Visual Studio test on non-Windows platform '%s'\n" % sys.platform
test.skip_test(msg)
-expected_vcprojfile = """\
+vcproj_template = """\
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
\tProjectType="Visual C++"
@@ -84,21 +84,7 @@ expected_vcprojfile = """\
\t</Configurations>
\t<References>
\t</References>
-\t<Files>
-\t\t\t<Filter
-\t\t\t\tName="subdir"
-\t\t\t\tFilter="">
-\t\t\t<File
-\t\t\t\tRelativePath="subdir\\test1.cpp">
-\t\t\t</File>
-\t\t\t<File
-\t\t\t\tRelativePath="subdir\\test2.cpp">
-\t\t\t</File>
-\t\t\t</Filter>
-\t\t<File
-\t\t\tRelativePath="<SCONSCRIPT>">
-\t\t</File>
-\t</Files>
+%(sln_files)s
\t<Globals>
\t</Globals>
</VisualStudioProject>
@@ -107,9 +93,9 @@ expected_vcprojfile = """\
SConscript_contents = """\
-env=Environment(MSVS_VERSION = '8.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '8.0')
-testsrc = ['subdir/test1.cpp', r'subdir\\test2.cpp']
+testsrc = %(testsrc)s
env.MSVSProject(target = 'Test.vcproj',
slnguid = '{SLNGUID}',
@@ -123,16 +109,74 @@ env.MSVSProject(target = 'Test.vcproj',
test.subdir('work1')
-test.write(['work1', 'SConstruct'], SConscript_contents)
+testsrc = repr([
+ 'prefix/subdir1/test1.cpp',
+ r'prefix\subdir1\test2.cpp',
+ 'prefix/subdir2/test3.cpp',
+])
+
+sln_files = """\t<Files>
+\t\t\t<Filter
+\t\t\t\tName="subdir1"
+\t\t\t\tFilter="">
+\t\t\t<File
+\t\t\t\tRelativePath="prefix\\subdir1\\test1.cpp">
+\t\t\t</File>
+\t\t\t<File
+\t\t\t\tRelativePath="prefix\\subdir1\\test2.cpp">
+\t\t\t</File>
+\t\t\t</Filter>
+\t\t\t<Filter
+\t\t\t\tName="subdir2"
+\t\t\t\tFilter="">
+\t\t\t<File
+\t\t\t\tRelativePath="prefix\\subdir2\\test3.cpp">
+\t\t\t</File>
+\t\t\t</Filter>
+\t\t<File
+\t\t\tRelativePath="<SCONSCRIPT>">
+\t\t</File>
+\t</Files>"""
+
+test.write(['work1', 'SConstruct'], SConscript_contents % locals())
test.run(chdir='work1', arguments="Test.vcproj")
test.must_exist(test.workpath('work1', 'Test.vcproj'))
vcproj = test.read(['work1', 'Test.vcproj'], 'r')
+expected_vcprojfile = vcproj_template % locals()
expect = test.msvs_substitute(expected_vcprojfile, '8.0', 'work1', 'SConstruct')
# don't compare the pickled data
assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
+test.subdir('work2')
+
+testsrc = repr([
+ 'prefix/subdir/somefile.cpp',
+])
+
+sln_files = """\t<Files>
+\t\t\t<File
+\t\t\t\tRelativePath="prefix\\subdir\\somefile.cpp">
+\t\t\t</File>
+\t\t<File
+\t\t\tRelativePath="<SCONSCRIPT>">
+\t\t</File>
+\t</Files>"""
+
+test.write(['work2', 'SConstruct'], SConscript_contents % locals())
+
+test.run(chdir='work2', arguments="Test.vcproj")
+
+test.must_exist(test.workpath('work2', 'Test.vcproj'))
+vcproj = test.read(['work2', 'Test.vcproj'], 'r')
+expected_vcprojfile = vcproj_template % locals()
+expect = test.msvs_substitute(expected_vcprojfile, '8.0', 'work2', 'SConstruct')
+# don't compare the pickled data
+assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
+
+
+
test.pass_test()
diff --git a/test/MSVS/runfile.py b/test/MSVS/runfile.py
index 581de64..5638916 100644
--- a/test/MSVS/runfile.py
+++ b/test/MSVS/runfile.py
@@ -100,7 +100,7 @@ expected_vcprojfile = """\
SConscript_contents = """\
-env=Environment(MSVS_VERSION = '8.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '8.0')
env.MSVSProject(target = 'Test.vcproj',
slnguid = '{SLNGUID}',
diff --git a/test/MSVS/vs-6.0-files.py b/test/MSVS/vs-6.0-files.py
index 135bb7f..ce7ef46 100644
--- a/test/MSVS/vs-6.0-files.py
+++ b/test/MSVS/vs-6.0-files.py
@@ -184,7 +184,7 @@ Package=<3>
SConscript_contents = """\
-env=Environment(MSVS_VERSION = '6.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '6.0')
testsrc = ['test.c']
testincs = ['sdk.h']
@@ -278,7 +278,7 @@ The real workspace file is here:
test.subdir('work3')
test.write(['work3', 'SConstruct'], """\
-env=Environment(MSVS_VERSION = '6.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '6.0')
testsrc = ['test.c']
testincs = ['sdk.h']
diff --git a/test/MSVS/vs-7.0-files.py b/test/MSVS/vs-7.0-files.py
index 8c82d1a..8f98166 100644
--- a/test/MSVS/vs-7.0-files.py
+++ b/test/MSVS/vs-7.0-files.py
@@ -144,7 +144,7 @@ expected_vcprojfile = """\
SConscript_contents = """\
-env=Environment(MSVS_VERSION = '7.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '7.0')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']
@@ -206,7 +206,7 @@ os.environ['PYTHON_ROOT'] = 'xyzzy'
test.run(chdir='work1', arguments='Test.vcproj')
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(sys.executable)[1])
+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')
@@ -260,7 +260,7 @@ The real workspace file is here:
test.subdir('work3')
test.write(['work3', 'SConstruct'], """\
-env=Environment(MSVS_VERSION = '7.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '7.0')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']
diff --git a/test/MSVS/vs-7.1-files.py b/test/MSVS/vs-7.1-files.py
index bbe6f1e..3ad2e97 100644
--- a/test/MSVS/vs-7.1-files.py
+++ b/test/MSVS/vs-7.1-files.py
@@ -146,7 +146,7 @@ expected_vcprojfile = """\
SConscript_contents = """\
-env=Environment(MSVS_VERSION = '7.1')
+env=Environment(tools=['msvs'], MSVS_VERSION = '7.1')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']
@@ -208,7 +208,7 @@ os.environ['PYTHON_ROOT'] = 'xyzzy'
test.run(chdir='work1', arguments='Test.vcproj')
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(sys.executable)[1])
+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')
@@ -262,7 +262,7 @@ The real workspace file is here:
test.subdir('work3')
test.write(['work3', 'SConstruct'], """\
-env=Environment(MSVS_VERSION = '7.1')
+env=Environment(tools=['msvs'], MSVS_VERSION = '7.1')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']
diff --git a/test/MSVS/vs-8.0-files.py b/test/MSVS/vs-8.0-files.py
index 878aa3f..1d3c469 100644
--- a/test/MSVS/vs-8.0-files.py
+++ b/test/MSVS/vs-8.0-files.py
@@ -153,7 +153,7 @@ expected_vcprojfile = """\
SConscript_contents = """\
-env=Environment(MSVS_VERSION = '8.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '8.0')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']
@@ -215,7 +215,7 @@ os.environ['PYTHON_ROOT'] = 'xyzzy'
test.run(chdir='work1', arguments='Test.vcproj')
-python = os.path.join('$(PYTHON_ROOT)', os.path.split(sys.executable)[1])
+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')
@@ -273,7 +273,7 @@ The real workspace file is here:
test.subdir('work3')
test.write(['work3', 'SConstruct'], """\
-env=Environment(MSVS_VERSION = '8.0')
+env=Environment(tools=['msvs'], MSVS_VERSION = '8.0')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']