aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-05-22 12:16:31 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2019-05-27 01:24:08 +0300
commit0714ba58c7e3683156a258649e723518c0e2ddc7 (patch)
treefe9de4f0b6e78511e92d9b9a018ff9aa7ac9cbe6 /run_unittests.py
parent0d19d334a8b8e6ebbb1ebdaa5658790a01fdc466 (diff)
downloadmeson-0714ba58c7e3683156a258649e723518c0e2ddc7.zip
meson-0714ba58c7e3683156a258649e723518c0e2ddc7.tar.gz
meson-0714ba58c7e3683156a258649e723518c0e2ddc7.tar.bz2
coredata: add cmake_prefix_path option
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index d64e60e..b477aa3 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -163,6 +163,20 @@ def skipIfNoPkgconfigDep(depname):
return wrapped
return wrapper
+def skip_if_no_cmake(f):
+ '''
+ Skip this test if no cmake is found, unless we're on CI.
+ This allows users to run our test suite without having
+ cmake installed on, f.ex., macOS, while ensuring that our CI does not
+ silently skip the test because of misconfiguration.
+ '''
+ @functools.wraps(f)
+ def wrapped(*args, **kwargs):
+ if not is_ci() and shutil.which('cmake') is None:
+ raise unittest.SkipTest('cmake not found')
+ return f(*args, **kwargs)
+ return wrapped
+
def skip_if_not_language(lang):
def wrapper(func):
@functools.wraps(func)
@@ -3662,6 +3676,11 @@ recommended as it is not supported on some platforms''')
# just test that the command does not fail (e.g. because it throws an exception)
self._run([*self.meson_command, 'unstable-coredata', self.builddir])
+ @skip_if_no_cmake
+ def test_cmake_prefix_path(self):
+ testdir = os.path.join(self.unit_test_dir, '60 cmake_prefix_path')
+ self.init(testdir, extra_args=['-Dcmake_prefix_path=' + os.path.join(testdir, 'prefix')])
+
class FailureTests(BasePlatformTests):
'''
Tests that test failure conditions. Build files here should be dynamically