summaryrefslogtreecommitdiff
path: root/test/MSVC
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2012-12-22 12:41:34 +0100
committerDirk Baechle <dl9obn@darc.de>2012-12-22 12:41:34 +0100
commit48395483d853df4b81c50553b3a4de3a023d6cee (patch)
treee6b605a6107af094133c618053090973e9e7cea8 /test/MSVC
parent6cede4390b5abb1424e9b79f159cb9567f28bd9c (diff)
downloadscons-48395483d853df4b81c50553b3a4de3a023d6cee.tar.gz
- moved check for an installed MSVC toolchain into its own function in TestSCons
Diffstat (limited to 'test/MSVC')
-rw-r--r--test/MSVC/PCH-source.py11
-rw-r--r--test/MSVC/PCHSTOP-errors.py11
-rw-r--r--test/MSVC/TARGET_ARCH.py10
-rw-r--r--test/MSVC/batch-longlines.py10
-rw-r--r--test/MSVC/embed-manifest.py11
-rw-r--r--test/MSVC/hierarchical.py12
-rw-r--r--test/MSVC/msvc.py10
-rw-r--r--test/MSVC/multiple-pdb.py11
-rw-r--r--test/MSVC/pch-spaces-subdir.py10
-rw-r--r--test/MSVC/pdb-VariantDir-path.py11
-rw-r--r--test/MSVC/pdb-manifest.py11
-rw-r--r--test/MSVC/query_vcbat.py11
12 files changed, 12 insertions, 117 deletions
diff --git a/test/MSVC/PCH-source.py b/test/MSVC/PCH-source.py
index c3c0f2e3..6015fec3 100644
--- a/test/MSVC/PCH-source.py
+++ b/test/MSVC/PCH-source.py
@@ -31,20 +31,11 @@ up in both the env.PCH() and the env.Program() source list.
Issue 2505: http://scons.tigris.org/issues/show_bug.cgi?id=2505
"""
-import sys
-
import TestSCons
test = TestSCons.TestSCons()
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
test.write('SConstruct', """\
env = Environment(tools=['msvc', 'mslink'])
diff --git a/test/MSVC/PCHSTOP-errors.py b/test/MSVC/PCHSTOP-errors.py
index d3ffc70b..aa14a3fb 100644
--- a/test/MSVC/PCHSTOP-errors.py
+++ b/test/MSVC/PCHSTOP-errors.py
@@ -29,21 +29,12 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
import re
-import sys
import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re)
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
-
+test.skip_if_not_msvc()
SConstruct_path = test.workpath('SConstruct')
diff --git a/test/MSVC/TARGET_ARCH.py b/test/MSVC/TARGET_ARCH.py
index 8b1c39d5..1df28d00 100644
--- a/test/MSVC/TARGET_ARCH.py
+++ b/test/MSVC/TARGET_ARCH.py
@@ -29,20 +29,12 @@ Test the ability to configure the $TARGET_ARCH construction variable.
"""
import TestSCons
-import sys
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
test.write('SConstruct', """
env_64 = Environment(tools=['default', 'msvc'],
diff --git a/test/MSVC/batch-longlines.py b/test/MSVC/batch-longlines.py
index a5786fad..ef7233b1 100644
--- a/test/MSVC/batch-longlines.py
+++ b/test/MSVC/batch-longlines.py
@@ -30,19 +30,11 @@ Verify operation of Visual C/C++ batch builds with long lines.
Only runs on Windows.
"""
-import sys
import TestSCons
test = TestSCons.TestSCons()
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
_python_ = TestSCons._python_
diff --git a/test/MSVC/embed-manifest.py b/test/MSVC/embed-manifest.py
index 286c2c7a..13f1defb 100644
--- a/test/MSVC/embed-manifest.py
+++ b/test/MSVC/embed-manifest.py
@@ -28,8 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Verify that manifest files get embedded correctly in EXEs and DLLs
"""
-import sys
-
import TestSCons
_exe = TestSCons._exe
@@ -38,14 +36,7 @@ _lib = TestSCons._lib
test = TestSCons.TestSCons()
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
test.write('SConstruct', """\
env=Environment(WINDOWS_EMBED_MANIFEST=True)
diff --git a/test/MSVC/hierarchical.py b/test/MSVC/hierarchical.py
index 72e58133..0b19483b 100644
--- a/test/MSVC/hierarchical.py
+++ b/test/MSVC/hierarchical.py
@@ -28,21 +28,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Verify use of Visual Studio with a hierarchical build.
"""
-import sys
-
import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re)
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
-
+test.skip_if_not_msvc()
test.subdir('src', 'build', 'out')
diff --git a/test/MSVC/msvc.py b/test/MSVC/msvc.py
index d98ffbe4..c68fb45f 100644
--- a/test/MSVC/msvc.py
+++ b/test/MSVC/msvc.py
@@ -29,21 +29,13 @@ Verify basic invocation of Microsoft Visual C/C++, including use
of a precompiled header with the $CCFLAGS variable.
"""
-import sys
import time
import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re)
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
#####
# Test the basics
diff --git a/test/MSVC/multiple-pdb.py b/test/MSVC/multiple-pdb.py
index 8e866399..78805e3d 100644
--- a/test/MSVC/multiple-pdb.py
+++ b/test/MSVC/multiple-pdb.py
@@ -33,22 +33,13 @@ $TARGET variable (and implicitly $SOURCE), using the original specified
list(s).
"""
-import sys
-
import TestSCons
_exe = TestSCons._exe
test = TestSCons.TestSCons()
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
test.write('SConstruct', """\
env = Environment(PDB = '${TARGET.base}.pdb')
diff --git a/test/MSVC/pch-spaces-subdir.py b/test/MSVC/pch-spaces-subdir.py
index 2b66a554..3a65b442 100644
--- a/test/MSVC/pch-spaces-subdir.py
+++ b/test/MSVC/pch-spaces-subdir.py
@@ -28,21 +28,13 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Verify PCH works if variant dir has spaces in its name
"""
-import sys
import time
import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re)
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
test.write('Main.cpp', """\
#include "Precompiled.h"
diff --git a/test/MSVC/pdb-VariantDir-path.py b/test/MSVC/pdb-VariantDir-path.py
index 899208ea..838487cb 100644
--- a/test/MSVC/pdb-VariantDir-path.py
+++ b/test/MSVC/pdb-VariantDir-path.py
@@ -28,22 +28,13 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Verify that .pdb files get put in a variant_dir correctly.
"""
-import sys
-
import TestSCons
_exe = TestSCons._exe
test = TestSCons.TestSCons()
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
test.subdir('src')
diff --git a/test/MSVC/pdb-manifest.py b/test/MSVC/pdb-manifest.py
index 46189ac2..e06fe0cf 100644
--- a/test/MSVC/pdb-manifest.py
+++ b/test/MSVC/pdb-manifest.py
@@ -28,8 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Verify that .pdb files work correctly in conjunction with manifest files.
"""
-import sys
-
import TestSCons
_exe = TestSCons._exe
@@ -38,14 +36,7 @@ _lib = TestSCons._lib
test = TestSCons.TestSCons()
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
test.write('SConstruct', """\
env = Environment()
diff --git a/test/MSVC/query_vcbat.py b/test/MSVC/query_vcbat.py
index f07f780b..328345df 100644
--- a/test/MSVC/query_vcbat.py
+++ b/test/MSVC/query_vcbat.py
@@ -23,20 +23,11 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import sys
-
import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re)
-if sys.platform != 'win32':
- msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform
- test.skip_test(msg)
-
-import SCons.Tool.MSCommon as msc
-if not msc.msvc_exists():
- msg = "No MSVC toolchain found...skipping test\n"
- test.skip_test(msg)
+test.skip_if_not_msvc()
#####
# Test the basics