diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-03 16:14:51 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-11-11 23:06:49 +0530 |
commit | e0b56942a0e0b28730e56347b1d2f6cc03fb96d2 (patch) | |
tree | d0adccdde8e6e77a2ea44a6c82301d1e9c974388 | |
parent | a63d81bafe5436a452c6df6a332dbda10e519078 (diff) | |
download | meson-e0b56942a0e0b28730e56347b1d2f6cc03fb96d2.zip meson-e0b56942a0e0b28730e56347b1d2f6cc03fb96d2.tar.gz meson-e0b56942a0e0b28730e56347b1d2f6cc03fb96d2.tar.bz2 |
unit tests: Properly skip if pkg-config wasn't found
-rwxr-xr-x | run_unittests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index fa3610b..0ed365f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1454,6 +1454,8 @@ int main(int argc, char **argv) { passed to dependency() with pkg-config. Can't be an ordinary test because we need to build libs and try to find them from meson.build ''' + if not shutil.which('pkg-config'): + raise unittest.SkipTest('pkg-config not found') (cc, objext, shext) = self.detect_prebuild_env() testdir = os.path.join(self.unit_test_dir, '17 pkgconfig static') source = os.path.join(testdir, 'foo.c') @@ -1562,6 +1564,8 @@ class FailureTests(BasePlatformTests): def test_dependency(self): if not shutil.which('pkg-config'): raise unittest.SkipTest('pkg-config not found') + if subprocess.call(['pkg-config', '--exists', 'zlib']) != 0: + raise unittest.SkipTest('zlib not found with pkg-config') a = (("dependency('zlib', method : 'fail')", "'fail' is invalid"), ("dependency('zlib', static : '1')", "[Ss]tatic.*boolean"), ("dependency('zlib', version : 1)", "[Vv]ersion.*string or list"), |