summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Moody <dmoody256@gmail.com>2019-01-09 10:20:17 -0600
committerDaniel Moody <dmoody256@gmail.com>2019-01-09 10:22:58 -0600
commitf8de931ad51d8f81770c47c7ba6259eccaee0503 (patch)
treec2af1288e6cb1bb3616c4198e22ed25e768dc3c7
parent39bdae14fbee3f7c724ec64b38f117849cbebeda (diff)
downloadscons-git-f8de931ad51d8f81770c47c7ba6259eccaee0503.tar.gz
reverted tests so they can use a default host == target platform for find msvc
fixed some other tests
-rw-r--r--src/engine/SCons/Tool/MSCommon/vc.py4
-rw-r--r--test/AS/ASFLAGS.py2
-rw-r--r--test/AS/ASPPFLAGS.py2
-rw-r--r--test/CC/CCFLAGS.py6
-rw-r--r--test/CC/CFLAGS.py2
-rw-r--r--test/LINK/SHLINKCOMSTR.py2
-rw-r--r--test/Libs/LIBPREFIXES.py2
-rw-r--r--test/Libs/LIBS.py6
-rw-r--r--test/Libs/LIBSUFFIXES.py6
-rw-r--r--test/Libs/SharedLibraryIxes.py2
-rw-r--r--test/long-lines/live.py2
-rw-r--r--test/sconsign/script/dblite.py2
-rw-r--r--testing/framework/TestSCons.py2
13 files changed, 19 insertions, 21 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py
index 168add5e9..ad921efd1 100644
--- a/src/engine/SCons/Tool/MSCommon/vc.py
+++ b/src/engine/SCons/Tool/MSCommon/vc.py
@@ -409,7 +409,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version):
return False
-def cached_get_installed_vcs(env):
+def cached_get_installed_vcs(env=None):
global __INSTALLED_VCS_RUN
if __INSTALLED_VCS_RUN is None:
@@ -643,7 +643,7 @@ def msvc_setup_env(env):
SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning,
"Could not find MSVC compiler 'cl.exe', it may need to be installed separately with Visual Studio")
-def msvc_exists(env, version=None):
+def msvc_exists(env=None, version=None):
vcs = cached_get_installed_vcs(env)
if version is None:
return len(vcs) > 0
diff --git a/test/AS/ASFLAGS.py b/test/AS/ASFLAGS.py
index b72d32dce..79fde8c74 100644
--- a/test/AS/ASFLAGS.py
+++ b/test/AS/ASFLAGS.py
@@ -42,7 +42,7 @@ o_c = ' -x -c'
if sys.platform == 'win32':
import SCons.Tool.MSCommon as msc
- if msc.msvc_exists(test.Environment()):
+ if msc.msvc_exists():
o_c = ' -x'
test.write('SConstruct', """
diff --git a/test/AS/ASPPFLAGS.py b/test/AS/ASPPFLAGS.py
index d548eaa9a..254a458d4 100644
--- a/test/AS/ASPPFLAGS.py
+++ b/test/AS/ASPPFLAGS.py
@@ -42,7 +42,7 @@ o_c = ' -x -c'
if sys.platform == 'win32':
import SCons.Tool.MSCommon as msc
- if msc.msvc_exists(test.Environment()):
+ if msc.msvc_exists():
o_c = ' -x'
test.write('SConstruct', """
diff --git a/test/CC/CCFLAGS.py b/test/CC/CCFLAGS.py
index a9db61f0f..069b42944 100644
--- a/test/CC/CCFLAGS.py
+++ b/test/CC/CCFLAGS.py
@@ -29,12 +29,10 @@ import TestSCons
_obj = TestSCons._obj
-test = TestSCons.TestSCons()
-
if sys.platform == 'win32':
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(test.Environment()):
+ if not msc.msvc_exists():
fooflags = '-DFOO'
barflags = '-DBAR'
else:
@@ -44,6 +42,8 @@ else:
fooflags = '-DFOO'
barflags = '-DBAR'
+test = TestSCons.TestSCons()
+
test.write('SConstruct', """
foo = Environment(CCFLAGS = '%s')
bar = Environment(CCFLAGS = '%s')
diff --git a/test/CC/CFLAGS.py b/test/CC/CFLAGS.py
index 6d0ee39e3..590d6b543 100644
--- a/test/CC/CFLAGS.py
+++ b/test/CC/CFLAGS.py
@@ -47,7 +47,7 @@ _obj = TestSCons._obj
if sys.platform == 'win32':
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(test.Environment()):
+ if not msc.msvc_exists():
fooflags = '-DFOO'
barflags = '-DBAR'
else:
diff --git a/test/LINK/SHLINKCOMSTR.py b/test/LINK/SHLINKCOMSTR.py
index bf419e512..4dd5c7c13 100644
--- a/test/LINK/SHLINKCOMSTR.py
+++ b/test/LINK/SHLINKCOMSTR.py
@@ -73,7 +73,7 @@ test.must_match('test3.dll', "test1.c\ntest2.c\n")
if sys.platform == "win32":
import SCons.Tool.MSCommon as msc
- if msc.msvc_exists(test.Environment()):
+ if msc.msvc_exists():
# Now test an actual compile and link. Since MS Windows
# resets the link actions, this could fail even if the above
# test passed.
diff --git a/test/Libs/LIBPREFIXES.py b/test/Libs/LIBPREFIXES.py
index b9621a1ac..aed451e3f 100644
--- a/test/Libs/LIBPREFIXES.py
+++ b/test/Libs/LIBPREFIXES.py
@@ -31,7 +31,7 @@ import TestSCons
if sys.platform == 'win32':
_lib = '.lib'
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(test.Environment()):
+ if not msc.msvc_exists():
_lib = '.a'
else:
_lib = '.a'
diff --git a/test/Libs/LIBS.py b/test/Libs/LIBS.py
index 079847542..563922869 100644
--- a/test/Libs/LIBS.py
+++ b/test/Libs/LIBS.py
@@ -27,19 +27,17 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
import sys
-test = TestSCons.TestSCons()
-
if sys.platform == 'win32':
_exe = '.exe'
bar_lib = 'bar.lib'
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(test.Environment()):
+ if not msc.msvc_exists():
bar_lib = 'libbar.a'
else:
_exe = ''
bar_lib = 'libbar.a'
-
+test = TestSCons.TestSCons()
test.subdir('sub1', 'sub2')
diff --git a/test/Libs/LIBSUFFIXES.py b/test/Libs/LIBSUFFIXES.py
index 030e6019b..13baeab9f 100644
--- a/test/Libs/LIBSUFFIXES.py
+++ b/test/Libs/LIBSUFFIXES.py
@@ -28,16 +28,16 @@ import os
import sys
import TestSCons
-test = TestSCons.TestSCons()
-
if sys.platform == 'win32':
lib_ = ''
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(test.Environment()):
+ if not msc.msvc_exists():
lib_ = 'lib'
else:
lib_ = 'lib'
+test = TestSCons.TestSCons()
+
test.write('SConstruct', """
env = Environment(LIBSUFFIX = '.xxx',
LIBSUFFIXES = ['.xxx'])
diff --git a/test/Libs/SharedLibraryIxes.py b/test/Libs/SharedLibraryIxes.py
index 2a5802647..93d67ea08 100644
--- a/test/Libs/SharedLibraryIxes.py
+++ b/test/Libs/SharedLibraryIxes.py
@@ -42,7 +42,7 @@ isWindows = sys.platform == 'win32'
isMingw = False
if isWindows:
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(test.Environment()):
+ if not msc.msvc_exists():
# We can't seem to find any MSVC version, so we assume
# that MinGW is installed instead. Accordingly, we use the
# standard gcc/g++ conventions for lib prefixes and suffixes
diff --git a/test/long-lines/live.py b/test/long-lines/live.py
index 8540cd798..5618f55f9 100644
--- a/test/long-lines/live.py
+++ b/test/long-lines/live.py
@@ -43,7 +43,7 @@ if sys.platform == 'win32':
linkflag_init = '/LIBPATH:' + test.workpath()
linkflag = ' /LIBPATH:' + test.workpath()
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(test.Environment()):
+ if not msc.msvc_exists():
lib_shared_dll = 'shared.dll'
lib_static_lib = 'libstatic.a'
arflag_init = 'r'
diff --git a/test/sconsign/script/dblite.py b/test/sconsign/script/dblite.py
index 36718f1e3..0daf8bf38 100644
--- a/test/sconsign/script/dblite.py
+++ b/test/sconsign/script/dblite.py
@@ -114,7 +114,7 @@ date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d'
if sys.platform == 'win32':
import SCons.Tool.MSCommon as msc
- if msc.msvc_exists(test.Environment()):
+ if msc.msvc_exists():
manifest = r"""
embedManifestExeCheck\(target, source, env\)"""
else:
diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py
index 01002c5d9..b543c07e3 100644
--- a/testing/framework/TestSCons.py
+++ b/testing/framework/TestSCons.py
@@ -1072,7 +1072,7 @@ SConscript( sconscript )
try:
import SCons.Tool.MSCommon as msc
- if not msc.msvc_exists(self.Environment()):
+ if not msc.msvc_exists():
msg = "No MSVC toolchain found...skipping test\n"
self.skip_test(msg)
except: