summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJoseph Brill <48932340+jcbrill@users.noreply.github.com>2024-10-07 20:57:59 (GMT)
committerJoseph Brill <48932340+jcbrill@users.noreply.github.com>2024-10-07 20:57:59 (GMT)
commit9e7f85a8e79058191d93122e4b7d3d22dae969b2 (patch)
tree26a8c360ad746bda458a62e7d7bcee7b33110739 /test
parent4af253800fbb03751e1b4537f1362a09dcfeef8a (diff)
downloadSCons-9e7f85a8e79058191d93122e4b7d3d22dae969b2.zip
SCons-9e7f85a8e79058191d93122e4b7d3d22dae969b2.tar.gz
SCons-9e7f85a8e79058191d93122e4b7d3d22dae969b2.tar.bz2
Fix MSVS tests and minor changes to Tool/msvs.py.
testing/framework/TestSConsMSVS.py: * Add default project GUID * Pass MSVS_PROJECT_GUID via environment * Add AdditionalOptions Condition to expected vcx project file * Fix vs version number for vc version 14.3 * Fix expected platform toolset version SCons/Tool/msvs.py: * User environment MSVS_PROJECT_GUID when creating project files info * Fix writing Visual Studio 15 for VS2015 * Add .vcxprof as an expected suffix for assigning the name to the file base name Fix early exit after vc version 8.0 (exit at the end of first loop execution) in: * test/MSVS/vs-files.py * test/MSVS/vs-scc-files.py * test/MSVS/vs-scc-legacy-files.py * test/MSVS/vs-variant_dir.py Tests: * Modify tests using TestSConsMSVS to add MSVS_PROJECT_GUID to the environment in the generated SConstruct/SConscript files. * Fix: delete env['PYTHON_ROOT'] before next loop iteration in test/MSVS/vs-files.py.
Diffstat (limited to 'test')
-rw-r--r--test/MSVS/common-prefix.py14
-rw-r--r--test/MSVS/runfile.py14
-rw-r--r--test/MSVS/vs-7.0-clean.py13
-rw-r--r--test/MSVS/vs-7.0-files.py12
-rw-r--r--test/MSVS/vs-7.0-scc-files.py7
-rw-r--r--test/MSVS/vs-7.0-scc-legacy-files.py7
-rw-r--r--test/MSVS/vs-7.0-variant_dir.py17
-rw-r--r--test/MSVS/vs-7.1-clean.py13
-rw-r--r--test/MSVS/vs-7.1-files.py12
-rw-r--r--test/MSVS/vs-7.1-scc-files.py7
-rw-r--r--test/MSVS/vs-7.1-scc-legacy-files.py7
-rw-r--r--test/MSVS/vs-7.1-variant_dir.py17
-rw-r--r--test/MSVS/vs-files.py5
-rw-r--r--test/MSVS/vs-scc-files.py8
-rw-r--r--test/MSVS/vs-scc-legacy-files.py7
-rw-r--r--test/MSVS/vs-variant_dir.py12
16 files changed, 60 insertions, 112 deletions
diff --git a/test/MSVS/common-prefix.py b/test/MSVS/common-prefix.py
index ea95c03..90417a2 100644
--- a/test/MSVS/common-prefix.py
+++ b/test/MSVS/common-prefix.py
@@ -38,6 +38,8 @@ if sys.platform != 'win32':
msg = "Skipping Visual Studio test on non-Windows platform '%s'\n" % sys.platform
test.skip_test(msg)
+msvs_project_guid = TestSConsMSVS.MSVS_PROJECT_GUID
+
vcproj_template = """\
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
@@ -83,10 +85,10 @@ vcproj_template = """\
</VisualStudioProject>
"""
-
-
SConscript_contents = """\
-env=Environment(tools=['msvs'], MSVS_VERSION = '8.0')
+env=Environment(tools=['msvs'],
+ MSVS_VERSION = '8.0',
+ MSVS_PROJECT_GUID = '%(msvs_project_guid)s')
testsrc = %(testsrc)s
@@ -98,8 +100,6 @@ env.MSVSProject(target = 'Test.vcproj',
auto_build_solution = 0)
"""
-
-
test.subdir('work1')
testsrc = repr([
@@ -142,8 +142,6 @@ 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([
@@ -170,8 +168,6 @@ 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()
# Local Variables:
diff --git a/test/MSVS/runfile.py b/test/MSVS/runfile.py
index d2319f3..bdd541d 100644
--- a/test/MSVS/runfile.py
+++ b/test/MSVS/runfile.py
@@ -38,6 +38,8 @@ if sys.platform != 'win32':
msg = "Skipping Visual Studio test on non-Windows platform '%s'\n" % sys.platform
test.skip_test(msg)
+sconscript_dict = {'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
+
expected_vcprojfile = """\
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
@@ -90,10 +92,10 @@ expected_vcprojfile = """\
</VisualStudioProject>
"""
-
-
SConscript_contents = """\
-env=Environment(tools=['msvs'], MSVS_VERSION = '8.0')
+env=Environment(tools=['msvs'],
+ MSVS_VERSION = '8.0',
+ MSVS_PROJECT_GUID = '%(MSVS_PROJECT_GUID)s')
env.MSVSProject(target = 'Test.vcproj',
slnguid = '{SLNGUID}',
@@ -104,11 +106,9 @@ env.MSVSProject(target = 'Test.vcproj',
auto_build_solution = 0)
"""
-
-
test.subdir('work1')
-test.write(['work1', 'SConstruct'], SConscript_contents)
+test.write(['work1', 'SConstruct'], SConscript_contents % sconscript_dict)
test.run(chdir='work1', arguments="Test.vcproj")
@@ -118,8 +118,6 @@ 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.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.0-clean.py b/test/MSVS/vs-7.0-clean.py
index 1194cc1..04d8d15 100644
--- a/test/MSVS/vs-7.0-clean.py
+++ b/test/MSVS/vs-7.0-clean.py
@@ -34,20 +34,17 @@ import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
-
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.0']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_0
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_0
-
-
test.write('SConstruct', """\
env=Environment(platform='win32', tools=['msvs'],
- MSVS_VERSION='7.0',HOST_ARCH='%(HOST_ARCH)s')
+ MSVS_VERSION='7.0',
+ MSVS_PROJECT_GUID='%(MSVS_PROJECT_GUID)s',
+ HOST_ARCH='%(HOST_ARCH)s')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']
@@ -69,7 +66,7 @@ env.MSVSSolution(target = 'Test.sln',
slnguid = '{SLNGUID}',
projects = [p],
variant = 'Release')
-"""%{'HOST_ARCH':host_arch})
+""" % {'HOST_ARCH':host_arch, 'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID})
test.run(arguments=".")
@@ -104,8 +101,6 @@ test.run(arguments='-c Test.vcproj')
test.must_not_exist(test.workpath('Test.vcproj'))
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.0-files.py b/test/MSVS/vs-7.0-files.py
index 9dc33b7..163f0a5 100644
--- a/test/MSVS/vs-7.0-files.py
+++ b/test/MSVS/vs-7.0-files.py
@@ -35,20 +35,16 @@ import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
-
+sconscript_dict = {'HOST_ARCH': host_arch, 'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.0']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_0
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_0
SConscript_contents = TestSConsMSVS.SConscript_contents_7_0
-
-
-test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch})
+test.write('SConstruct', SConscript_contents % sconscript_dict)
test.run(arguments="Test.vcproj")
@@ -79,8 +75,6 @@ test.run(arguments='-c Test.sln')
test.must_not_exist(test.workpath('Test.vcproj'))
test.must_not_exist(test.workpath('Test.sln'))
-
-
# Test that running SCons with $PYTHON_ROOT in the environment
# changes the .vcproj output as expected.
os.environ['PYTHON_ROOT'] = 'xyzzy'
@@ -95,8 +89,6 @@ 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.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.0-scc-files.py b/test/MSVS/vs-7.0-scc-files.py
index f1f77db..a1f3c43 100644
--- a/test/MSVS/vs-7.0-scc-files.py
+++ b/test/MSVS/vs-7.0-scc-files.py
@@ -37,12 +37,11 @@ test = TestSConsMSVS.TestSConsMSVS()
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.0']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_0
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_0
SConscript_contents = \
r"""env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.0',
+ MSVS_PROJECT_GUID='%(MSVS_PROJECT_GUID)s',
CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')],
CPPPATH=['inc1', 'inc2'],
MSVS_SCC_CONNECTION_ROOT='.',
@@ -65,7 +64,7 @@ env.MSVSProject(target = 'Test.vcproj',
misc = testmisc,
buildtarget = 'Test.exe',
variant = 'Release')
-"""
+""" % {'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
expected_sln_sccinfo = """\
\tGlobalSection(SourceCodeControl) = preSolution
@@ -89,7 +88,6 @@ expected_vcproj_sccinfo = """\
\tSccProvider="MSSCCI:Perforce SCM"
"""
-
test.write('SConstruct', SConscript_contents)
test.run(arguments="Test.vcproj")
@@ -108,7 +106,6 @@ 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.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.0-scc-legacy-files.py b/test/MSVS/vs-7.0-scc-legacy-files.py
index a180b8a..d579102 100644
--- a/test/MSVS/vs-7.0-scc-legacy-files.py
+++ b/test/MSVS/vs-7.0-scc-legacy-files.py
@@ -37,12 +37,11 @@ test = TestSConsMSVS.TestSConsMSVS()
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.0']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_0
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_0
SConscript_contents = """\
env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.0',
+ MSVS_PROJECT_GUID='%(MSVS_PROJECT_GUID)s',
CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')],
CPPPATH=['inc1', 'inc2'],
MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects',
@@ -63,14 +62,13 @@ env.MSVSProject(target = 'Test.vcproj',
misc = testmisc,
buildtarget = 'Test.exe',
variant = 'Release')
-"""
+""" % {'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
expected_vcproj_sccinfo = """\
\tSccProjectName="Perforce Project"
\tSccLocalPath="C:\\MyMsVsProjects"
"""
-
test.write('SConstruct', SConscript_contents)
test.run(arguments="Test.vcproj")
@@ -88,7 +86,6 @@ 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.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.0-variant_dir.py b/test/MSVS/vs-7.0-variant_dir.py
index 41c3cdc..5ec3b55 100644
--- a/test/MSVS/vs-7.0-variant_dir.py
+++ b/test/MSVS/vs-7.0-variant_dir.py
@@ -33,40 +33,33 @@ import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
-
+sconscript_dict = {'HOST_ARCH': host_arch, 'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.0']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_0
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_0
SConscript_contents = TestSConsMSVS.SConscript_contents_7_0
-
-
test.subdir('src')
test.write('SConstruct', """\
SConscript('src/SConscript', variant_dir='build')
""")
-test.write(['src', 'SConscript'], SConscript_contents%{'HOST_ARCH': host_arch})
+test.write(['src', 'SConscript'], SConscript_contents % sconscript_dict)
test.run(arguments=".")
-project_guid = "{CB4637F1-2205-50B7-B115-DCFA0DA68FB1}"
vcproj = test.read(['src', 'Test.vcproj'], 'r')
-expect = test.msvs_substitute(expected_vcprojfile, '7.0', None, 'SConstruct',
- project_guid=project_guid)
+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('src', 'Test.sln'))
sln = test.read(['src', 'Test.sln'], 'r')
-expect = test.msvs_substitute(expected_slnfile, '7.0', 'src',
- project_guid=project_guid)
+expect = test.msvs_substitute(expected_slnfile, '7.0', 'src')
# don't compare the pickled data
assert sln[:len(expect)] == expect, test.diff_substr(expect, sln)
@@ -84,8 +77,6 @@ The real workspace file is here:
""" % test.workpath('src', 'Test.sln'),
mode='r')
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.1-clean.py b/test/MSVS/vs-7.1-clean.py
index 8c9cb87..665871c 100644
--- a/test/MSVS/vs-7.1-clean.py
+++ b/test/MSVS/vs-7.1-clean.py
@@ -34,20 +34,17 @@ import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
-
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.1']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_1
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_1
-
-
test.write('SConstruct', """\
env=Environment(platform='win32', tools=['msvs'],
- MSVS_VERSION='7.1',HOST_ARCH='%(HOST_ARCH)s')
+ MSVS_VERSION='7.1',
+ MSVS_PROJECT_GUID='%(MSVS_PROJECT_GUID)s',
+ HOST_ARCH='%(HOST_ARCH)s')
testsrc = ['test1.cpp', 'test2.cpp']
testincs = ['sdk.h']
@@ -69,7 +66,7 @@ env.MSVSSolution(target = 'Test.sln',
slnguid = '{SLNGUID}',
projects = [p],
variant = 'Release')
-"""%{'HOST_ARCH':host_arch})
+""" % {'HOST_ARCH':host_arch, 'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID})
test.run(arguments=".")
@@ -104,8 +101,6 @@ test.run(arguments='-c Test.vcproj')
test.must_not_exist(test.workpath('Test.vcproj'))
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.1-files.py b/test/MSVS/vs-7.1-files.py
index e2a40a8..e372fe0 100644
--- a/test/MSVS/vs-7.1-files.py
+++ b/test/MSVS/vs-7.1-files.py
@@ -35,20 +35,16 @@ import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
-
+sconscript_dict = {'HOST_ARCH': host_arch, 'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.1']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_1
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_1
SConscript_contents = TestSConsMSVS.SConscript_contents_7_1
-
-
-test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch})
+test.write('SConstruct', SConscript_contents % sconscript_dict)
test.run(arguments="Test.vcproj")
@@ -79,8 +75,6 @@ test.run(arguments='-c Test.sln')
test.must_not_exist(test.workpath('Test.vcproj'))
test.must_not_exist(test.workpath('Test.sln'))
-
-
# Test that running SCons with $PYTHON_ROOT in the environment
# changes the .vcproj output as expected.
os.environ['PYTHON_ROOT'] = 'xyzzy'
@@ -95,8 +89,6 @@ expect = test.msvs_substitute(expected_vcprojfile, '7.1', None, 'SConstruct',
# don't compare the pickled data
assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.1-scc-files.py b/test/MSVS/vs-7.1-scc-files.py
index 0b42930..fbc83de 100644
--- a/test/MSVS/vs-7.1-scc-files.py
+++ b/test/MSVS/vs-7.1-scc-files.py
@@ -37,12 +37,11 @@ test = TestSConsMSVS.TestSConsMSVS()
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.1']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_1
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_1
SConscript_contents = """\
env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.1',
+ MSVS_PROJECT_GUID='%(MSVS_PROJECT_GUID)s',
CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')],
CPPPATH=['inc1', 'inc2'],
MSVS_SCC_CONNECTION_ROOT='.',
@@ -65,7 +64,7 @@ env.MSVSProject(target = 'Test.vcproj',
misc = testmisc,
buildtarget = 'Test.exe',
variant = 'Release')
-"""
+""" % {'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
expected_sln_sccinfo = """\
\tGlobalSection(SourceCodeControl) = preSolution
@@ -89,7 +88,6 @@ expected_vcproj_sccinfo = """\
\tSccProvider="MSSCCI:Perforce SCM"
"""
-
test.write('SConstruct', SConscript_contents)
test.run(arguments="Test.vcproj")
@@ -108,7 +106,6 @@ expect = test.msvs_substitute(expected_slnfile, '7.1', None, 'SConstruct',
# don't compare the pickled data
assert sln[:len(expect)] == expect, test.diff_substr(expect, sln)
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.1-scc-legacy-files.py b/test/MSVS/vs-7.1-scc-legacy-files.py
index bb184d6..335ef8b 100644
--- a/test/MSVS/vs-7.1-scc-legacy-files.py
+++ b/test/MSVS/vs-7.1-scc-legacy-files.py
@@ -37,12 +37,11 @@ test = TestSConsMSVS.TestSConsMSVS()
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.1']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_1
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_1
SConscript_contents = """\
env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.1',
+ MSVS_PROJECT_GUID='%(MSVS_PROJECT_GUID)s',
CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')],
CPPPATH=['inc1', 'inc2'],
MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects',
@@ -63,14 +62,13 @@ env.MSVSProject(target = 'Test.vcproj',
misc = testmisc,
buildtarget = 'Test.exe',
variant = 'Release')
-"""
+""" % {'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
expected_vcproj_sccinfo = """\
\tSccProjectName="Perforce Project"
\tSccLocalPath="C:\\MyMsVsProjects"
"""
-
test.write('SConstruct', SConscript_contents)
test.run(arguments="Test.vcproj")
@@ -88,7 +86,6 @@ expect = test.msvs_substitute(expected_slnfile, '7.1', None, 'SConstruct')
# don't compare the pickled data
assert sln[:len(expect)] == expect, test.diff_substr(expect, sln)
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-7.1-variant_dir.py b/test/MSVS/vs-7.1-variant_dir.py
index 64467de..b4de417 100644
--- a/test/MSVS/vs-7.1-variant_dir.py
+++ b/test/MSVS/vs-7.1-variant_dir.py
@@ -33,40 +33,33 @@ import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
-
+sconscript_dict = {'HOST_ARCH': host_arch, 'MSVS_PROJECT_GUID': TestSConsMSVS.MSVS_PROJECT_GUID}
# Make the test infrastructure think we have this version of MSVS installed.
test._msvs_versions = ['7.1']
-
-
expected_slnfile = TestSConsMSVS.expected_slnfile_7_1
expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_1
SConscript_contents = TestSConsMSVS.SConscript_contents_7_1
-
-
test.subdir('src')
test.write('SConstruct', """\
SConscript('src/SConscript', variant_dir='build')
""")
-test.write(['src', 'SConscript'], SConscript_contents%{'HOST_ARCH': host_arch})
+test.write(['src', 'SConscript'], SConscript_contents % sconscript_dict)
test.run(arguments=".")
-project_guid = "{CB4637F1-2205-50B7-B115-DCFA0DA68FB1}"
vcproj = test.read(['src', 'Test.vcproj'], 'r')
-expect = test.msvs_substitute(expected_vcprojfile, '7.0', None, 'SConstruct',
- project_guid=project_guid)
+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('src', 'Test.sln'))
sln = test.read(['src', 'Test.sln'], 'r')
-expect = test.msvs_substitute(expected_slnfile, '7.0', 'src',
- project_guid=project_guid)
+expect = test.msvs_substitute(expected_slnfile, '7.0', 'src')
# don't compare the pickled data
assert sln[:len(expect)] == expect, test.diff_substr(expect, sln)
@@ -84,8 +77,6 @@ The real workspace file is here:
""" % test.workpath('src', 'Test.sln'),
mode='r')
-
-
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-files.py b/test/MSVS/vs-files.py
index b330ce7..5493356 100644
--- a/test/MSVS/vs-files.py
+++ b/test/MSVS/vs-files.py
@@ -33,6 +33,8 @@ import os
import TestSConsMSVS
+test = None
+
for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions():
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
@@ -103,6 +105,9 @@ for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions():
# don't compare the pickled data
assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj)
+ del os.environ['PYTHON_ROOT']
+
+if test:
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-scc-files.py b/test/MSVS/vs-scc-files.py
index 85fa27c..1cbbd8c 100644
--- a/test/MSVS/vs-scc-files.py
+++ b/test/MSVS/vs-scc-files.py
@@ -31,6 +31,8 @@ solution (.sln) files that contain SCC information and look correct.
import TestSConsMSVS
+test = None
+
for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions():
test = TestSConsMSVS.TestSConsMSVS()
@@ -46,6 +48,7 @@ for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions():
expected_vcprojfile = test.get_expected_proj_file_contents(vc_version, dirs, project_file)
SConscript_contents = """\
env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='{vc_version}',
+ MSVS_PROJECT_GUID='{project_guid}',
CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')],
CPPPATH=['inc1', 'inc2'],
MSVS_SCC_CONNECTION_ROOT='.',
@@ -66,7 +69,7 @@ env.MSVSProject(target = '{project_file}',
misc = testmisc,
buildtarget = 'Test.exe',
variant = 'Release')
-""".format(vc_version=vc_version, project_file=project_file)
+""".format(vc_version=vc_version, project_file=project_file, project_guid=TestSConsMSVS.MSVS_PROJECT_GUID)
expected_sln_sccinfo = """\
\tGlobalSection(SourceCodeControl) = preSolution
@@ -97,7 +100,6 @@ env.MSVSProject(target = '{project_file}',
\t\t<SccProvider>MSSCCI:Perforce SCM</SccProvider>
"""
-
test.write('SConstruct', SConscript_contents)
test.run(arguments=project_file)
@@ -116,7 +118,7 @@ env.MSVSProject(target = '{project_file}',
# don't compare the pickled data
assert sln[:len(expect)] == expect, test.diff_substr(expect, sln)
-
+if test:
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-scc-legacy-files.py b/test/MSVS/vs-scc-legacy-files.py
index 8e2ca15..88efca8 100644
--- a/test/MSVS/vs-scc-legacy-files.py
+++ b/test/MSVS/vs-scc-legacy-files.py
@@ -31,6 +31,8 @@ solution (.sln) files that contain SCC information and look correct.
import TestSConsMSVS
+test = None
+
for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions():
test = TestSConsMSVS.TestSConsMSVS()
@@ -47,6 +49,7 @@ for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions():
SConscript_contents = """\
env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='{vc_version}',
+ MSVS_PROJECT_GUID='{project_guid}',
CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')],
CPPPATH=['inc1', 'inc2'],
MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects',
@@ -66,7 +69,7 @@ env.MSVSProject(target = '{project_file}',
misc = testmisc,
buildtarget = 'Test.exe',
variant = 'Release')
-""".format(vc_version=vc_version, project_file=project_file)
+""".format(vc_version=vc_version, project_file=project_file, project_guid=TestSConsMSVS.MSVS_PROJECT_GUID)
if major < 10:
# VC8 and VC9 used key-value pair format.
@@ -98,7 +101,7 @@ env.MSVSProject(target = '{project_file}',
# don't compare the pickled data
assert sln[:len(expect)] == expect, test.diff_substr(expect, sln)
-
+if test:
test.pass_test()
# Local Variables:
diff --git a/test/MSVS/vs-variant_dir.py b/test/MSVS/vs-variant_dir.py
index 7d4b9cb..880a36e 100644
--- a/test/MSVS/vs-variant_dir.py
+++ b/test/MSVS/vs-variant_dir.py
@@ -31,6 +31,8 @@ solution (.sln) files that look correct when using a variant_dir.
import TestSConsMSVS
+test = None
+
for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions():
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
@@ -58,21 +60,18 @@ SConscript('src/SConscript', variant_dir='build')
test.run(arguments=".")
- project_guid = "{CB4637F1-2205-50B7-B115-DCFA0DA68FB1}"
vcproj = test.read(['src', project_file], 'r')
- expect = test.msvs_substitute(expected_vcprojfile, vc_version, None, 'SConstruct',
- project_guid=project_guid)
+ expect = test.msvs_substitute(expected_vcprojfile, vc_version, None, 'SConstruct')
# don't compare the pickled data
assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj)
test.must_exist(test.workpath('src', 'Test.sln'))
sln = test.read(['src', 'Test.sln'], 'r')
- expect = test.msvs_substitute(expected_slnfile, '8.0', 'src',
- project_guid=project_guid)
+ expect = test.msvs_substitute(expected_slnfile, '8.0', 'src')
# don't compare the pickled data
assert sln[:len(expect)] == expect, test.diff_substr(expect, sln)
- test.must_match(['build', 'Test.vcproj'], """\
+ test.must_match(['build', project_file], """\
This is just a placeholder file.
The real project file is here:
%s
@@ -84,6 +83,7 @@ The real workspace file is here:
%s
""" % test.workpath('src', 'Test.sln'), mode='r')
+if test:
test.pass_test()
# Local Variables: