aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-10-23 15:13:08 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2018-11-04 15:42:06 +0000
commitbb0bbfc2abad8925425f13775f2ee514f76ee069 (patch)
tree0e8249a7311c96f6636462642fbdfc509b461ffb
parentd35034b21bfdcbdb21853340ff983e908ada101f (diff)
downloadmeson-bb0bbfc2abad8925425f13775f2ee514f76ee069.zip
meson-bb0bbfc2abad8925425f13775f2ee514f76ee069.tar.gz
meson-bb0bbfc2abad8925425f13775f2ee514f76ee069.tar.bz2
Adjust more tests which need to know compiler type
-rwxr-xr-xrun_unittests.py2
-rw-r--r--test cases/common/124 cpp and asm/meson.build2
-rw-r--r--test cases/common/13 pch/mixed/meson.build3
-rw-r--r--test cases/common/132 generated assembly/meson.build4
-rw-r--r--test cases/common/190 openmp/meson.build3
-rw-r--r--test cases/common/204 function attributes/meson.build6
6 files changed, 11 insertions, 9 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 474b87a..5fbc34c 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2449,7 +2449,7 @@ recommended as it is not supported on some platforms''')
testdirlib = os.path.join(testdirbase, 'lib')
extra_args = None
env = get_fake_env(testdirlib, self.builddir, self.prefix)
- if env.detect_c_compiler(False).get_id() != 'msvc':
+ if env.detect_c_compiler(False).get_id() not in ['msvc', 'clang-cl']:
# static libraries are not linkable with -l with msvc because meson installs them
# as .a files which unix_args_to_native will not know as it expects libraries to use
# .lib as extension. For a DLL the import library is installed as .lib. Thus for msvc
diff --git a/test cases/common/124 cpp and asm/meson.build b/test cases/common/124 cpp and asm/meson.build
index 9160775..f097084 100644
--- a/test cases/common/124 cpp and asm/meson.build
+++ b/test cases/common/124 cpp and asm/meson.build
@@ -15,7 +15,7 @@ endif
sources = ['trivial.cc']
# If the compiler cannot compile assembly, don't use it
-if meson.get_compiler('cpp').get_id() != 'msvc'
+if not ['msvc', 'clang-cl'].contains(meson.get_compiler('cpp').get_id())
sources += ['retval-' + cpu + '.S']
cpp_args = ['-DUSE_ASM']
message('Using ASM')
diff --git a/test cases/common/13 pch/mixed/meson.build b/test cases/common/13 pch/mixed/meson.build
index 7f6033d..f0c3eca 100644
--- a/test cases/common/13 pch/mixed/meson.build
+++ b/test cases/common/13 pch/mixed/meson.build
@@ -5,8 +5,9 @@ exe = executable(
cpp_pch : ['pch/main_pch.cc', 'pch/main.h'],
)
+# test pch when only a header is given (not supported by msvc)
cc = meson.get_compiler('c')
-if cc.get_id() != 'msvc'
+if not ['msvc', 'clang-cl'].contains(cc.get_id())
exe2 = executable(
'prog2',
files('main.cc', 'func.c'),
diff --git a/test cases/common/132 generated assembly/meson.build b/test cases/common/132 generated assembly/meson.build
index 6a8744b..5fb7429 100644
--- a/test cases/common/132 generated assembly/meson.build
+++ b/test cases/common/132 generated assembly/meson.build
@@ -2,8 +2,8 @@ project('generated assembly', 'c')
cc = meson.get_compiler('c')
-if cc.get_id() == 'msvc'
- error('MESON_SKIP_TEST: assembly files cannot be compiled directly by MSVC')
+if ['msvc', 'clang-cl'].contains(cc.get_id())
+ error('MESON_SKIP_TEST: assembly files cannot be compiled directly by the compiler')
endif
cpu = host_machine.cpu_family()
diff --git a/test cases/common/190 openmp/meson.build b/test cases/common/190 openmp/meson.build
index eb270ab..018bf24 100644
--- a/test cases/common/190 openmp/meson.build
+++ b/test cases/common/190 openmp/meson.build
@@ -10,6 +10,9 @@ endif
if cc.get_id() == 'msvc' and cc.version().version_compare('<17')
error('MESON_SKIP_TEST msvc is too old to support OpenMP.')
endif
+if cc.get_id() == 'clang-cl'
+ error('MESON_SKIP_TEST clang-cl does not support OpenMP.')
+endif
if host_machine.system() == 'darwin'
error('MESON_SKIP_TEST macOS does not support OpenMP.')
endif
diff --git a/test cases/common/204 function attributes/meson.build b/test cases/common/204 function attributes/meson.build
index e46533f..c906b49 100644
--- a/test cases/common/204 function attributes/meson.build
+++ b/test cases/common/204 function attributes/meson.build
@@ -19,7 +19,7 @@ project('gcc func attributes', ['c', 'cpp'])
c = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')
-expected_result = c.get_id() != 'msvc'
+expected_result = not ['msvc', 'clang-cl'].contains(c.get_id())
# Q: Why is ifunc not in this list or any of the below lists?
# A: It's too damn hard to figure out if you actually support it, since it
@@ -57,8 +57,6 @@ if c.get_id() != 'intel'
attributes += 'weakref'
endif
-expected_result = c.get_id() != 'msvc'
-
# These are unsupported on darwin with apple clang 9.1.0
if host_machine.system() != 'darwin'
attributes += 'alias'
@@ -97,7 +95,7 @@ foreach a : ['dllexport', 'dllimport']
endforeach
message('checking get_supported_function_attributes')
-if c.get_id() != 'msvc'
+if not ['msvc', 'clang-cl'].contains(c.get_id())
multi_expected = attributes
else
multi_expected = []