aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-06-06 21:43:30 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-06-07 16:40:52 -0400
commit95ee4d7d1360afd13532bd4663c776a1fce5980d (patch)
tree732b3726cf37b60a6bcee58158a0bb96a9b864a9 /test cases
parent96f660083278bc5c7498bf4819a4077b3ea109a1 (diff)
downloadmeson-95ee4d7d1360afd13532bd4663c776a1fce5980d.zip
meson-95ee4d7d1360afd13532bd4663c776a1fce5980d.tar.gz
meson-95ee4d7d1360afd13532bd4663c776a1fce5980d.tar.bz2
tests: be DRY in llvm framework test
It's a lot more readable to not repeat big arrays.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/frameworks/15 llvm/meson.build29
1 files changed, 15 insertions, 14 deletions
diff --git a/test cases/frameworks/15 llvm/meson.build b/test cases/frameworks/15 llvm/meson.build
index ab297ec..806ba7b 100644
--- a/test cases/frameworks/15 llvm/meson.build
+++ b/test cases/frameworks/15 llvm/meson.build
@@ -3,15 +3,23 @@ project('llvmtest', ['c', 'cpp'], default_options : ['c_std=c99'])
method = get_option('method')
static = get_option('link-static')
+d = dependency('llvm', required : false, static : static)
+if not d.found()
+ error('MESON_SKIP_TEST llvm not found.')
+endif
+
+modules_to_find = [
+ 'bitwriter', 'asmprinter', 'executionengine', 'mcjit', 'target',
+ 'nativecodegen', 'amdgpu', 'engine'
+]
+
if(method == 'combination')
- d = dependency('llvm', version : static ? '>0.1' : '>=7.0', required : false, static : static)
- if not d.found()
- error('MESON_SKIP_TEST llvm not found or llvm version is too low')
+ if not d.version().version_compare(static ? '>0.1' : '>=7.0')
+ error('MESON_SKIP_TEST: llvm version is too low')
endif
llvm_ct_dep = dependency(
'llvm',
- modules : ['bitwriter', 'asmprinter', 'executionengine', 'target',
- 'mcjit', 'nativecodegen', 'amdgpu', 'engine'],
+ modules : modules_to_find,
required : false,
static : static,
method : 'config-tool',
@@ -29,8 +37,7 @@ if(method == 'combination')
else
llvm_cm_dep = dependency(
'llvm',
- modules : ['bitwriter', 'asmprinter', 'executionengine', 'target',
- 'mcjit', 'nativecodegen', 'amdgpu', 'engine'],
+ modules : modules_to_find,
required : false,
static : static,
method : 'cmake',
@@ -45,11 +52,6 @@ if(method == 'combination')
assert(cm_version_major == ct_version_major, 'config-tool and cmake returns different major versions')
assert(cm_version_minor == ct_version_minor, 'config-tool and cmake returns different minor versions')
else
- d = dependency('llvm', required : false, method : method, static : static)
- if not d.found()
- error('MESON_SKIP_TEST llvm not found.')
- endif
-
if(not static and method == 'cmake')
d = dependency('llvm', version : '>=7.0', required : false, static : static)
if not d.found()
@@ -92,8 +94,7 @@ else
else
llvm_dep = dependency(
'llvm',
- modules : ['bitwriter', 'asmprinter', 'executionengine', 'target',
- 'mcjit', 'nativecodegen', 'amdgpu'],
+ modules : modules_to_find,
required : false,
static : static,
method : method,