tests: Improve llvm dependency test coverage

pull/1900/head
Nirbheek Chauhan 8 years ago
parent 3a33a8ef49
commit 38716f0fcb
  1. 2
      mesonbuild/dependencies/dev.py
  2. 4
      run_unittests.py
  3. 7
      test cases/frameworks/15 llvm/meson.build

@ -202,6 +202,8 @@ class LLVMDependency(ExternalDependency):
out = out.strip() out = out.strip()
if p.returncode != 0: if p.returncode != 0:
continue continue
# FIXME: As soon as some llvm-config is found, version checks
# in further dependnecy() calls will be ignored
if version_req: if version_req:
if version_compare(out, version_req, strict=True): if version_compare(out, version_req, strict=True):
if cls.__best_found and version_compare(out, '<={}'.format(cls.__best_found), strict=True): if cls.__best_found and version_compare(out, '<={}'.format(cls.__best_found), strict=True):

@ -1256,6 +1256,10 @@ class FailureTests(BasePlatformTests):
for contents, match in a: for contents, match in a:
self.assertMesonRaises(contents, match) self.assertMesonRaises(contents, match)
def test_llvm_dependency(self):
self.assertMesonRaises("dependency('llvm', modules : 'fail')",
"(required.*fail|{})".format(self.dnf))
class WindowsTests(BasePlatformTests): class WindowsTests(BasePlatformTests):
''' '''

@ -7,4 +7,11 @@ llvm_dep = dependency(
required : true, required : true,
) )
d = dependency('llvm', modules : 'not-found', required : false)
assert(d.found() == false, 'not-found llvm module found')
# XXX: Version checks are broken, see FIXME in LLVMDependency
#d = dependency('llvm', version : '<0.1', required : false)
#assert(d.found() == false, 'ancient llvm module found')
executable('sum', 'sum.c', dependencies : llvm_dep) executable('sum', 'sum.c', dependencies : llvm_dep)

Loading…
Cancel
Save