diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/compiler_detection/msvc_version.c | 8 | ||||
-rwxr-xr-x | src/scripts/python_uniitests.py | 16 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/build-data/compiler_detection/msvc_version.c b/src/build-data/compiler_detection/msvc_version.c new file mode 100644 index 000000000..054f69d28 --- /dev/null +++ b/src/build-data/compiler_detection/msvc_version.c @@ -0,0 +1,8 @@ +// _MSC_VER Defined as an integer literal that encodes the major and minor +// number elements of the compiler's version number. The major number is +// the first element of the period-delimited version number and the minor +// number is the second element. For example, if the version number of the +// Visual C++ compiler is 17.00.51106.1, the _MSC_VER macro evaluates to 1700. +// https://msdn.microsoft.com/en-us/library/b0084kay.aspx + +_MSC_VER diff --git a/src/scripts/python_uniitests.py b/src/scripts/python_uniitests.py index 4f8bc42b5..f7b1bc97e 100755 --- a/src/scripts/python_uniitests.py +++ b/src/scripts/python_uniitests.py @@ -41,7 +41,7 @@ class CompilerDetection(unittest.TestCase): compiler_out = "" self.assertEqual(detector.version_from_compiler_output(compiler_out), None) - compiler_out = "Compiler Version 1900242131. for x86" + compiler_out = "Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24213.1 for x86" self.assertEqual(detector.version_from_compiler_output(compiler_out), None) def test_gcc_version(self): @@ -84,19 +84,9 @@ Selected multilib: .;@m64""" def test_msvc_version(self): detector = CompilerDetector("msvc", "cl.exe", "windows") - compiler_out = """Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24213.1 for x86 -Copyright (C) Microsoft Corporation. All rights reserved. + compiler_out = """msvc_version.c -usage: cl [ option... ] filename... [ /link linkoption... ] -""" - self.assertEqual(detector.version_from_compiler_output(compiler_out), "2015") - - def test_msvc_version_german(self): - detector = CompilerDetector("msvc", "cl.exe", "windows") - compiler_out = """Microsoft (R) C/C++-Optimierungscompiler Version 19.00.24213.1 für x86 -Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. - -Syntax: cl [ Option... ] Dateiname... [ /link Linkeroption... ] +1900 """ self.assertEqual(detector.version_from_compiler_output(compiler_out), "2015") |