summaryrefslogtreecommitdiff
path: root/unittests/linuxliketests.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-06-06 12:10:35 -0400
committerXavier Claessens <xclaesse@gmail.com>2023-08-03 16:27:52 -0400
commit183e4b8e903c6c4c057d09549e669d6292478a4e (patch)
tree02e0e2306ef78a797d992914c4badd2c34b180ed /unittests/linuxliketests.py
parentf077cb2ee3fba55fc0e1be327ad791c19f3c3b5e (diff)
downloadmeson-183e4b8e903c6c4c057d09549e669d6292478a4e.tar.gz
PkgConfigDependency: Move CLI handling into its own abstraction
This makes the code cleaner and will allow to have other implementations in the future.
Diffstat (limited to 'unittests/linuxliketests.py')
-rw-r--r--unittests/linuxliketests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py
index 7ebb575a7..bd73857e9 100644
--- a/unittests/linuxliketests.py
+++ b/unittests/linuxliketests.py
@@ -45,7 +45,7 @@ from mesonbuild.compilers.c import AppleClangCCompiler
from mesonbuild.compilers.cpp import AppleClangCPPCompiler
from mesonbuild.compilers.objc import AppleClangObjCCompiler
from mesonbuild.compilers.objcpp import AppleClangObjCPPCompiler
-from mesonbuild.dependencies.pkgconfig import PkgConfigDependency
+from mesonbuild.dependencies.pkgconfig import PkgConfigDependency, PkgConfigCLI
import mesonbuild.modules.pkgconfig
PKG_CONFIG = os.environ.get('PKG_CONFIG', 'pkg-config')
@@ -173,7 +173,8 @@ class LinuxlikeTests(BasePlatformTests):
self.assertEqual(libhello_nolib.get_compile_args(), [])
self.assertEqual(libhello_nolib.get_pkgconfig_variable('foo', [], None), 'bar')
self.assertEqual(libhello_nolib.get_pkgconfig_variable('prefix', [], None), self.prefix)
- if version_compare(PkgConfigDependency.check_pkgconfig(env, libhello_nolib.pkgbin),">=0.29.1"):
+ impl = libhello_nolib.pkgconfig
+ if not isinstance(impl, PkgConfigCLI) or version_compare(PkgConfigCLI.check_pkgconfig(env, impl.pkgbin),">=0.29.1"):
self.assertEqual(libhello_nolib.get_pkgconfig_variable('escaped_var', [], None), r'hello\ world')
self.assertEqual(libhello_nolib.get_pkgconfig_variable('unescaped_var', [], None), 'hello world')
@@ -1168,7 +1169,7 @@ class LinuxlikeTests(BasePlatformTests):
# Regression test: This used to modify the value of `pkg_config_path`
# option, adding the meson-uninstalled directory to it.
- PkgConfigDependency.setup_env({}, env, MachineChoice.HOST, uninstalled=True)
+ PkgConfigCLI.setup_env({}, env, MachineChoice.HOST, uninstalled=True)
pkg_config_path = env.coredata.options[OptionKey('pkg_config_path')].value
self.assertEqual(pkg_config_path, [pkg_dir])