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 /QMTest | |
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 'QMTest')
-rw-r--r-- | QMTest/TestSCons.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index ea18757..b015637 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -976,6 +976,28 @@ SConscript( sconscript ) return libs + def skip_if_not_msvc(self, check_platform=True): + """ Check whether we are on a Windows platform and skip the + test if not. This check can be omitted by setting + check_platform to False. + Then, for a win32 platform, additionally check + whether we have a MSVC toolchain installed + in the system, and skip the test if none can be + found (=MinGW is the only compiler available). + """ + if check_platform: + if sys.platform != 'win32': + msg = "Skipping Visual C/C++ test on non-Windows platform '%s'\n" % sys.platform + self.skip_test(msg) + return + + try: + import SCons.Tool.MSCommon as msc + if not msc.msvc_exists(): + msg = "No MSVC toolchain found...skipping test\n" + self.skip_test(msg) + except: + pass def checkLogAndStdout(self, checks, results, cached, logfile, sconf_dir, sconstruct, |