diff options
author | Jack Lloyd <[email protected]> | 2017-09-08 10:39:57 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-08 10:39:57 -0400 |
commit | 941ceaa926244509f522d528cf6dff6286ec0593 (patch) | |
tree | 442d632a4173e80838f1a7a5d789684817877113 /src | |
parent | 640935ce79db9316f6e92ecc32579d39726c616a (diff) | |
parent | 13192be8bd753fd20ecd19a059cbcb2c22d41bfd (diff) |
Merge GH #1193 Improve Apple Clang detection logic
Diffstat (limited to 'src')
-rwxr-xr-x | src/scripts/python_unittests.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/scripts/python_unittests.py b/src/scripts/python_unittests.py index 1df35f0cd..37068ed1c 100755 --- a/src/scripts/python_unittests.py +++ b/src/scripts/python_unittests.py @@ -110,6 +110,31 @@ Thread model: posix InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin""" self.assertEqual(detector.version_from_compiler_output(compiler_out), "4.0") + def test_clang_version_appleclang_intermediate(self): + # fake versions in between the knwon ones + # clang-700.0.0 is lower than all known versions + # clang-802.1.0 is a minor update of known clang-802 + # clang-1111.9.99 is a random future value + detector = CompilerDetector("clang", "clang++", "darwin") + + compiler_out = """Apple LLVM version 7.0.0 (clang-700.0.0) +Target: x86_64-apple-darwin16.7.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin""" + self.assertEqual(detector.version_from_compiler_output(compiler_out), "3.7") + + compiler_out = """Apple LLVM version 8.1.1 (clang-802.1.0) +Target: x86_64-apple-darwin16.7.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin""" + self.assertEqual(detector.version_from_compiler_output(compiler_out), "3.9") + + compiler_out = """Apple LLVM version 11.11.0 (clang-1111.9.99) +Target: x86_64-apple-darwin16.7.0 +Thread model: posix +InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin""" + self.assertEqual(detector.version_from_compiler_output(compiler_out), "4.0") + def test_msvc_version(self): detector = CompilerDetector("msvc", "cl.exe", "windows") compiler_out = """msvc_version.c |