From 40c197d524181713968ac5a1f052671744915c62 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 21 Jul 2020 23:05:17 -0400 Subject: pkgconfig: Fix various corner cases See unit tests for the exact scenarios this PR fixes. --- run_unittests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 73131c7..2b0e4e1 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5836,6 +5836,19 @@ class LinuxlikeTests(BasePlatformTests): out = self._run(cmd + ['--libs'], override_envvars=env).strip().split() self.assertEqual(out, ['-llibmain2', '-llibinternal']) + # See common/47 pkgconfig-gen/meson.build for description of the case this test + with open(os.path.join(privatedir1, 'simple2.pc')) as f: + content = f.read() + self.assertIn('Libs: -L${libdir} -lsimple2 -lz -lsimple1', content) + + with open(os.path.join(privatedir1, 'simple3.pc')) as f: + content = f.read() + self.assertEqual(1, content.count('-lsimple3')) + + with open(os.path.join(privatedir1, 'simple5.pc')) as f: + content = f.read() + self.assertNotIn('-lstat2', content) + def test_pkgconfig_uninstalled(self): testdir = os.path.join(self.common_test_dir, '47 pkgconfig-gen') self.init(testdir) -- cgit v1.1