diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-06-11 00:06:02 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-06-18 06:33:23 +0000 |
commit | d2d1a7c573805236cc42490a9e7a5127ad02e051 (patch) | |
tree | ed73ed5ab8c59305c3881bc7a1364e29cffebd0e | |
parent | 96b7fdb723e5a8d2d7143c7c7a6abc433e0b3da0 (diff) | |
download | meson-d2d1a7c573805236cc42490a9e7a5127ad02e051.zip meson-d2d1a7c573805236cc42490a9e7a5127ad02e051.tar.gz meson-d2d1a7c573805236cc42490a9e7a5127ad02e051.tar.bz2 |
unittests: Assert that we have pkg-config on all CI
Our appveyor configuration provides pkg-config when building for
mingw, cygwin, msvc, etc.
Of course, people manually running the tests won't require pkg-config.
-rwxr-xr-x | run_unittests.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/run_unittests.py b/run_unittests.py index 1c722c1..0cfb4a9 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -74,15 +74,22 @@ def get_soname(fname): def get_rpath(fname): return get_dynamic_section_entry(fname, r'(?:rpath|runpath)') +def is_ci(): + if 'TRAVIS' in os.environ or 'APPVEYOR' in os.environ: + return True + return False + def skipIfNoPkgconfig(f): ''' - Skip this test if no pkg-config is found, unless we're on Travis CI - This allows users to run our test suite without having pkg-config installed - on, f.ex., macOS, while ensuring that our Travis CI does not silently skip - the test because of misconfiguration. + Skip this test if no pkg-config is found, unless we're on Travis or + Appveyor CI. This allows users to run our test suite without having + pkg-config installed on, f.ex., macOS, while ensuring that our CI does not + silently skip the test because of misconfiguration. + + Note: Yes, we provide pkg-config even while running Windows CI ''' def wrapped(*args, **kwargs): - if 'TRAVIS' not in os.environ and shutil.which('pkg-config') is None: + if is_ci() and shutil.which('pkg-config') is None: raise unittest.SkipTest('pkg-config not found') return f(*args, **kwargs) return wrapped |