unit tests: Fix test_compiler_detection on MinGW

The compiler is x86_64-foo-bar-gcc/g++, so also check for that.
This commit is contained in:
Nirbheek Chauhan 2017-12-02 02:29:09 +05:30
parent 387b5e67a0
commit 4e637a6910
1 changed files with 5 additions and 4 deletions

View File

@ -1061,16 +1061,17 @@ class AllPlatformTests(BasePlatformTests):
evalue = os.environ.pop(evar)
# Very rough/strict heuristics. Would never work for actual
# compiler detection, but should be ok for the tests.
if os.path.basename(evalue).startswith('g'):
ebase = os.path.basename(evalue)
if ebase.startswith('g') or ebase.endswith(('-gcc', '-g++')):
self.assertIsInstance(ecc, gnu)
self.assertIsInstance(elinker, ar)
elif 'clang' in os.path.basename(evalue):
elif 'clang' in ebase:
self.assertIsInstance(ecc, clang)
self.assertIsInstance(elinker, ar)
elif os.path.basename(evalue).startswith('ic'):
elif ebase.startswith('ic'):
self.assertIsInstance(ecc, intel)
self.assertIsInstance(elinker, ar)
elif os.path.basename(evalue).startswith('cl'):
elif ebase.startswith('cl'):
self.assertIsInstance(ecc, msvc)
self.assertIsInstance(elinker, lib)
else: