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.
pull/11066/head
Eli Schwartz 2 years ago
parent 908a78dbc2
commit b40e4de3c6
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      unittests/linuxliketests.py

@ -182,7 +182,7 @@ class LinuxlikeTests(BasePlatformTests):
for name in {'ct', 'ct0'}: for name in {'ct', 'ct0'}:
ct_dep = PkgConfigDependency(name, env, kwargs) ct_dep = PkgConfigDependency(name, env, kwargs)
self.assertTrue(ct_dep.found()) 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): def test_pkgconfig_gen_deps(self):
''' '''

Loading…
Cancel
Save