diff options
author | Dirk Baechle <dl9obn@darc.de> | 2012-12-22 11:41:34 (GMT) |
---|---|---|
committer | Dirk Baechle <dl9obn@darc.de> | 2012-12-22 11:41:34 (GMT) |
commit | 239a4bf92af5eb85ab9322610f46d0f6798f4d4b (patch) | |
tree | e6b605a6107af094133c618053090973e9e7cea8 /test | |
parent | 66e6ceeca3bfa6af0a367bf57dccb8a591e2a82f (diff) | |
download | SCons-239a4bf92af5eb85ab9322610f46d0f6798f4d4b.zip SCons-239a4bf92af5eb85ab9322610f46d0f6798f4d4b.tar.gz SCons-239a4bf92af5eb85ab9322610f46d0f6798f4d4b.tar.bz2 |
- moved check for an installed MSVC toolchain into its own function in TestSCons
Diffstat (limited to 'test')
-rw-r--r-- | test/IDL/midl.py | 10 | ||||
-rw-r--r-- | test/MSVC/PCH-source.py | 11 | ||||
-rw-r--r-- | test/MSVC/PCHSTOP-errors.py | 11 | ||||
-rw-r--r-- | test/MSVC/TARGET_ARCH.py | 10 | ||||
-rw-r--r-- | test/MSVC/batch-longlines.py | 10 | ||||
-rw-r--r-- | test/MSVC/embed-manifest.py | 11 | ||||
-rw-r--r-- | test/MSVC/hierarchical.py | 12 | ||||
-rw-r--r-- | test/MSVC/msvc.py | 10 | ||||
-rw-r--r-- | test/MSVC/multiple-pdb.py | 11 | ||||
-rw-r--r-- | test/MSVC/pch-spaces-subdir.py | 10 | ||||
-rw-r--r-- | test/MSVC/pdb-VariantDir-path.py | 11 | ||||
-rw-r--r-- | test/MSVC/pdb-manifest.py | 11 | ||||
-rw-r--r-- | test/MSVC/query_vcbat.py | 11 | ||||
-rw-r--r-- | test/Win32/win32pathmadness.py | 10 |
14 files changed, 14 insertions, 135 deletions
diff --git a/test/IDL/midl.py b/test/IDL/midl.py index 0322483..7ada153 100644 --- a/test/IDL/midl.py +++ b/test/IDL/midl.py @@ -25,20 +25,12 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import sys import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re) -if sys.platform != 'win32': - msg = "Skipping 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/PCH-source.py b/test/MSVC/PCH-source.py index c3c0f2e..6015fec 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 d3ffc70..aa14a3f 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 8b1c39d..1df28d0 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 a5786fa..ef7233b 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 286c2c7..13f1def 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 72e5813..0b19483 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 d98ffbe..c68fb45 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 8e86639..78805e3 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 2b66a55..3a65b44 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 899208e..838487c 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 46189ac..e06fe0c 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 f07f780..328345d 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 diff --git a/test/Win32/win32pathmadness.py b/test/Win32/win32pathmadness.py index fe6373d..925a323 100644 --- a/test/Win32/win32pathmadness.py +++ b/test/Win32/win32pathmadness.py @@ -31,20 +31,12 @@ inconsistent about which case is used for the drive letter. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons -import sys import TestCmd import os.path test = TestSCons.TestSCons(match=TestCmd.match_re) -if sys.platform != 'win32': - msg = "Skipping Windows path tests 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', 'include', 'src2') |