diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-08-20 00:45:52 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-08-19 16:03:22 -0700 |
commit | 38648bbb9f4e4cf6879b1b30ac4fc69816c87657 (patch) | |
tree | cac2eb172235baed5a031562cceea77aca0a13a5 /run_unittests.py | |
parent | 4a30f729f26072867ac3dac14c688b4e0b222804 (diff) | |
download | meson-38648bbb9f4e4cf6879b1b30ac4fc69816c87657.zip meson-38648bbb9f4e4cf6879b1b30ac4fc69816c87657.tar.gz meson-38648bbb9f4e4cf6879b1b30ac4fc69816c87657.tar.bz2 |
Fix various small test failures on macOS
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.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/run_unittests.py b/run_unittests.py index 54a1363..2e29af7 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -658,6 +658,9 @@ class InternalTests(unittest.TestCase): # Test ends PkgConfigDependency._call_pkgbin = old_call PkgConfigDependency.check_pkgconfig = old_check + # Reset dependency class to ensure that in-process configure doesn't mess up + PkgConfigDependency.pkgbin_cache = {} + PkgConfigDependency.class_pkgbin = None @unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release') @@ -2596,6 +2599,7 @@ class FailureTests(BasePlatformTests): and slows down testing. ''' dnf = "[Dd]ependency.*not found" + nopkg = '[Pp]kg-config not found' def setUp(self): super().setUp() @@ -2677,7 +2681,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 @@ -3463,6 +3471,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, '8 -L -l order') os.environ['PKG_CONFIG_PATH'] = testdir |