From b40e4de3c6cfd931a2c0d9ba8b798bfacd3662c6 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 17 Nov 2022 02:08:11 -0500 Subject: [PATCH] tests: fix potential failure to verify pkg-config generation We use a dummy project with a vague name and try to find flags for it based on the installable pkg-config files. This sort of works, generally, because it attempts to match `-lct` which doesn't exist because the test case isn't installed, and that link argument is passed directly through. Except, sometimes that library does exist. It is provided by the "freetds" project, which may be a dependency other tools. In that case, Meson finds a library, and the `dependency()` resolves to `/usr/lib/libct.so` and the test fails. Fortunately, we do have an API to say that we really want to get back the same flags pkg-config returned. Use this. --- unittests/linuxliketests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 8dd9cfc4e..a594348c4 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -182,7 +182,7 @@ class LinuxlikeTests(BasePlatformTests): for name in {'ct', 'ct0'}: ct_dep = PkgConfigDependency(name, env, kwargs) self.assertTrue(ct_dep.found()) - self.assertIn('-lct', ct_dep.get_link_args()) + self.assertIn('-lct', ct_dep.get_link_args(raw=True)) def test_pkgconfig_gen_deps(self): '''