diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-05-22 12:16:31 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-27 01:24:08 +0300 |
commit | 0714ba58c7e3683156a258649e723518c0e2ddc7 (patch) | |
tree | fe9de4f0b6e78511e92d9b9a018ff9aa7ac9cbe6 /run_unittests.py | |
parent | 0d19d334a8b8e6ebbb1ebdaa5658790a01fdc466 (diff) | |
download | meson-0714ba58c7e3683156a258649e723518c0e2ddc7.zip meson-0714ba58c7e3683156a258649e723518c0e2ddc7.tar.gz meson-0714ba58c7e3683156a258649e723518c0e2ddc7.tar.bz2 |
coredata: add cmake_prefix_path option
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 19 |
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 |