diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-08-20 00:45:52 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-08-24 07:07:28 +0530 |
commit | ca70ebbde80404fcf5526f698c2ed40e25853d52 (patch) | |
tree | ba5e9bdeb0e0c473f60bbe6fd01a8937a6c2c24c | |
parent | 8fba087e42f5a854f42e4fca60fa9d80d52dba3c (diff) | |
download | meson-ca70ebbde80404fcf5526f698c2ed40e25853d52.zip meson-ca70ebbde80404fcf5526f698c2ed40e25853d52.tar.gz meson-ca70ebbde80404fcf5526f698c2ed40e25853d52.tar.bz2 |
Fix various small test failures on macOS [skip appveyor]
These weren't caught by the CI because we have pkg-config on it, and
these were testing non-pkg-config codepaths. The unity build on macOS
now doesn't have pkg-config to ensure that the codepath is tested.
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | mesonbuild/dependencies/base.py | 2 | ||||
-rwxr-xr-x | run_unittests.py | 8 |
3 files changed, 11 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index 197c803..dd5cebb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,9 @@ matrix: before_install: - python ./skip_ci.py --base-branch-env=TRAVIS_BRANCH --is-pull-env=TRAVIS_PULL_REQUEST - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt pkg-config; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt; fi + # # Run one macOS build without pkg-config available, and the other (unity=on) with pkg-config + - if [[ "$TRAVIS_OS_NAME" == "osx" && "$MESON_ARGS" =~ .*unity=on.* ]]; then brew install pkg-config; fi # Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull jpakkane/mesonci:bionic; fi diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index fdb644d..6d3678f 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -1066,7 +1066,7 @@ class ExternalLibrary(ExternalDependency): class ExtraFrameworkDependency(ExternalDependency): def __init__(self, name, required, path, env, lang, kwargs): super().__init__('extraframeworks', env, lang, kwargs) - self.name = None + self.name = name self.required = required self.detect(name, path) if self.found(): diff --git a/run_unittests.py b/run_unittests.py index d137038..056f8e8 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2495,6 +2495,7 @@ class FailureTests(BasePlatformTests): and slows down testing. ''' dnf = "[Dd]ependency.*not found" + nopkg = '[Pp]kg-config not found' def setUp(self): super().setUp() @@ -2576,7 +2577,11 @@ class FailureTests(BasePlatformTests): if shutil.which('sdl2-config'): raise unittest.SkipTest('sdl2-config found') self.assertMesonRaises("dependency('sdl2', method : 'sdlconfig')", self.dnf) - self.assertMesonRaises("dependency('sdl2', method : 'pkg-config')", self.dnf) + if shutil.which('pkg-config'): + errmsg = self.dnf + else: + errmsg = self.nopkg + self.assertMesonRaises("dependency('sdl2', method : 'pkg-config')", errmsg) def test_gnustep_notfound_dependency(self): # Want to test failure, so skip if available @@ -3356,6 +3361,7 @@ class LinuxlikeTests(BasePlatformTests): for v in installed.values(): self.assertTrue('prog' in v or 'foo' in v) + @skipIfNoPkgconfig def test_order_of_l_arguments(self): testdir = os.path.join(self.unit_test_dir, '9 -L -l order') os.environ['PKG_CONFIG_PATH'] = testdir |