diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-12-22 18:44:03 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-12-22 18:44:03 (GMT) |
commit | 121bb2f745edeb13139ee512c6a5ea402c4d17e6 (patch) | |
tree | 9ac06cb38d20319138a8e58bbbe5713f2c014904 /QMTest | |
parent | 480db6f087a0cbee844ed4368f627a72f3451091 (diff) | |
parent | 239a4bf92af5eb85ab9322610f46d0f6798f4d4b (diff) | |
download | SCons-121bb2f745edeb13139ee512c6a5ea402c4d17e6.zip SCons-121bb2f745edeb13139ee512c6a5ea402c4d17e6.tar.gz SCons-121bb2f745edeb13139ee512c6a5ea402c4d17e6.tar.bz2 |
Merging pull request #62 from Dirk Baechle: fixes for MinGW tests
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, |