aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-10-23 15:11:26 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2018-11-04 15:42:06 +0000
commit198e8691625419b50000c5825209843184dd2441 (patch)
tree5e5a1b73e570f08f6b9e18e7e4ea8535e10ef7b7
parentac17f168eac45943fe972233835df68703579d7a (diff)
downloadmeson-198e8691625419b50000c5825209843184dd2441.zip
meson-198e8691625419b50000c5825209843184dd2441.tar.gz
meson-198e8691625419b50000c5825209843184dd2441.tar.bz2
Make use of get_argument_syntax() in test cases
-rwxr-xr-xrun_unittests.py16
-rw-r--r--test cases/common/112 spaces backslash/meson.build2
-rw-r--r--test cases/common/123 llvm ir and assembly/meson.build2
-rw-r--r--test cases/common/138 c cpp and asm/meson.build2
-rw-r--r--test cases/common/143 C and CPP link/meson.build2
-rw-r--r--test cases/common/186 has link arg/meson.build2
-rw-r--r--test cases/common/91 default options/meson.build5
7 files changed, 14 insertions, 17 deletions
diff --git a/run_unittests.py b/run_unittests.py
index adac19b..84dcd36 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -601,7 +601,7 @@ class InternalTests(unittest.TestCase):
elif is_cygwin():
self._test_all_naming(cc, env, patterns, 'cygwin')
elif is_windows():
- if cc.get_id() == 'msvc':
+ if cc.get_argument_syntax() == 'msvc':
self._test_all_naming(cc, env, patterns, 'windows-msvc')
else:
self._test_all_naming(cc, env, patterns, 'windows-mingw')
@@ -675,7 +675,7 @@ class InternalTests(unittest.TestCase):
bar_dep = PkgConfigDependency('bar', env, kwargs)
self.assertEqual(bar_dep.get_link_args(), [(p2 / 'libbar.a').as_posix()])
internal_dep = PkgConfigDependency('internal', env, kwargs)
- if compiler.get_id() == 'msvc':
+ if compiler.get_argument_syntax() == 'msvc':
self.assertEqual(internal_dep.get_link_args(), [])
else:
link_args = internal_dep.get_link_args()
@@ -1994,7 +1994,7 @@ int main(int argc, char **argv) {
def pbcompile(self, compiler, source, objectfile, extra_args=[]):
cmd = compiler.get_exelist()
- if compiler.id == 'msvc':
+ if compiler.get_argument_syntax() == 'msvc':
cmd += ['/nologo', '/Fo' + objectfile, '/c', source] + extra_args
else:
cmd += ['-c', source, '-o', objectfile] + extra_args
@@ -2016,7 +2016,7 @@ int main(int argc, char **argv) {
def build_static_lib(self, compiler, linker, source, objectfile, outfile, extra_args=None):
if extra_args is None:
extra_args = []
- if compiler.id == 'msvc':
+ if compiler.get_argument_syntax() == 'msvc':
link_cmd = ['lib', '/NOLOGO', '/OUT:' + outfile, objectfile]
else:
link_cmd = ['ar', 'csr', outfile, objectfile]
@@ -2049,7 +2049,7 @@ int main(int argc, char **argv) {
def build_shared_lib(self, compiler, source, objectfile, outfile, impfile, extra_args=None):
if extra_args is None:
extra_args = []
- if compiler.id == 'msvc':
+ if compiler.get_argument_syntax() == 'msvc':
link_cmd = ['link', '/NOLOGO', '/DLL', '/DEBUG',
'/IMPLIB:' + impfile, '/OUT:' + outfile, objectfile]
else:
@@ -2069,7 +2069,7 @@ int main(int argc, char **argv) {
source = os.path.join(tdir, 'alexandria.c')
objectfile = os.path.join(tdir, 'alexandria.' + object_suffix)
impfile = os.path.join(tdir, 'alexandria.lib')
- if cc.id == 'msvc':
+ if cc.get_argument_syntax() == 'msvc':
shlibfile = os.path.join(tdir, 'alexandria.' + shared_suffix)
elif is_cygwin():
shlibfile = os.path.join(tdir, 'cygalexandria.' + shared_suffix)
@@ -2107,7 +2107,7 @@ int main(int argc, char **argv) {
objectfile = os.path.join(testdir, 'foo.' + objext)
stlibfile = os.path.join(testdir, 'libfoo.a')
impfile = os.path.join(testdir, 'foo.lib')
- if cc.id == 'msvc':
+ if cc.get_argument_syntax() == 'msvc':
shlibfile = os.path.join(testdir, 'foo.' + shext)
elif is_cygwin():
shlibfile = os.path.join(testdir, 'cygfoo.' + shext)
@@ -3058,7 +3058,7 @@ class WindowsTests(BasePlatformTests):
testdir = os.path.join(self.platform_test_dir, '1 basic')
env = get_fake_env(testdir, self.builddir, self.prefix)
cc = env.detect_c_compiler(False)
- if cc.id != 'msvc':
+ if cc.get_argument_syntax() != 'msvc':
raise unittest.SkipTest('Not using MSVC')
# To force people to update this test, and also test
self.assertEqual(set(cc.ignore_libs), {'c', 'm', 'pthread', 'dl', 'rt'})
diff --git a/test cases/common/112 spaces backslash/meson.build b/test cases/common/112 spaces backslash/meson.build
index bf614e8..d590494 100644
--- a/test cases/common/112 spaces backslash/meson.build
+++ b/test cases/common/112 spaces backslash/meson.build
@@ -7,7 +7,7 @@ project('comparer', 'c')
include_dir = meson.current_source_dir() + '/include'
default_c_args = ['-I' + include_dir]
-if meson.get_compiler('c').get_id() == 'msvc'
+if meson.get_compiler('c').get_argument_syntax() == 'msvc'
default_c_args += ['/Faasm output\\']
# Hack to create the 'asm output' directory in the builddir
subdir('asm output')
diff --git a/test cases/common/123 llvm ir and assembly/meson.build b/test cases/common/123 llvm ir and assembly/meson.build
index 51321fb..1746c91 100644
--- a/test cases/common/123 llvm ir and assembly/meson.build
+++ b/test cases/common/123 llvm ir and assembly/meson.build
@@ -28,7 +28,7 @@ foreach lang : ['c', 'cpp']
# MSVC cannot directly compile assembly files, so we pass it through the
# cl.exe pre-processor first and then assemble it with the ml.exe assembler.
# Then we can link it into the executable.
- if cc_id == 'msvc'
+ if cc.get_argument_syntax() == 'msvc'
cl = find_program('cl')
if cpu == 'x86'
ml = find_program('ml')
diff --git a/test cases/common/138 c cpp and asm/meson.build b/test cases/common/138 c cpp and asm/meson.build
index 2c3610e..ca820e2 100644
--- a/test cases/common/138 c cpp and asm/meson.build
+++ b/test cases/common/138 c cpp and asm/meson.build
@@ -9,7 +9,7 @@ if not supported_cpus.contains(cpu)
error('MESON_SKIP_TEST unsupported cpu:' + cpu)
endif
-if meson.get_compiler('c').get_id() == 'msvc'
+if meson.get_compiler('c').get_argument_syntax() == 'msvc'
error('MESON_SKIP_TEST MSVC can\'t compile assembly')
endif
diff --git a/test cases/common/143 C and CPP link/meson.build b/test cases/common/143 C and CPP link/meson.build
index 55c1b87..d35a31b 100644
--- a/test cases/common/143 C and CPP link/meson.build
+++ b/test cases/common/143 C and CPP link/meson.build
@@ -25,7 +25,7 @@ libc = static_library('cfoo', ['foo.c', 'foo.h'])
# ourselves at configure time and then 'find' it with cxx.find_library().
cxx = meson.get_compiler('cpp')
-if cxx.get_id() == 'msvc'
+if cxx.get_argument_syntax() == 'msvc'
compile_cmd = ['/c', '@INPUT@', '/Fo@OUTPUT@']
stlib_cmd = ['lib', '/OUT:@OUTPUT@', '@INPUT@']
else
diff --git a/test cases/common/186 has link arg/meson.build b/test cases/common/186 has link arg/meson.build
index e166101..10f2218 100644
--- a/test cases/common/186 has link arg/meson.build
+++ b/test cases/common/186 has link arg/meson.build
@@ -3,7 +3,7 @@ project('has link arg', 'c', 'cpp')
cc = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')
-if cc.get_id() == 'msvc'
+if cc.get_argument_syntax() == 'msvc'
is_arg = '/OPT:REF'
useless = '/DEBUG'
isnt_arg = '/iambroken'
diff --git a/test cases/common/91 default options/meson.build b/test cases/common/91 default options/meson.build
index 9f45df0..c4c72ef 100644
--- a/test cases/common/91 default options/meson.build
+++ b/test cases/common/91 default options/meson.build
@@ -6,11 +6,9 @@ project('default options', 'cpp', 'c', default_options : [
'warning_level=3',
])
-cpp_id = meson.get_compiler('cpp').get_id()
-
assert(get_option('buildtype') == 'debugoptimized', 'Build type default value wrong.')
-if cpp_id == 'msvc'
+if meson.get_compiler('cpp').get_argument_syntax() == 'msvc'
cpp_eh = get_option('cpp_eh')
assert(cpp_eh == 'none', 'MSVC eh value is "' + cpp_eh + '" instead of "none"')
else
@@ -33,4 +31,3 @@ assert(w_level == '3', 'warning level "' + w_level + '" instead of "3"')
# assert(not cc.compiles('int foobar;'), 'Default arg not used in test.')
# assert(cc.compiles('int foobar;', no_builtin_args : true), 'No_builtin did not disable builtins.')
# endif
-