From 2881db7379506efbd110363cf9d77c94c4c6426a Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sat, 16 Dec 2017 09:50:11 -0500 Subject: pkgconfig: Move pc file checks to run_unittests.py --- run_unittests.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index d7d5ed0..acf029f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1912,6 +1912,36 @@ class LinuxlikeTests(BasePlatformTests): self.assertEqual(foo_dep.get_pkgconfig_variable('foo', {}), 'bar') self.assertPathEqual(foo_dep.get_pkgconfig_variable('datadir', {}), '/usr/data') + def test_pkgconfig_gen_deps(self): + ''' + Test that generated pkg-config files correctly handle dependencies + ''' + + testdir = os.path.join(self.common_test_dir, '51 pkgconfig-gen') + self.init(testdir) + + os.environ['PKG_CONFIG_LIBDIR'] = self.privatedir + cmd = ['pkg-config', 'dependency-test'] + + out = self._run(cmd + ['--print-requires']).strip().split() + self.assertEqual(sorted(out), sorted(['libexposed'])) + + out = self._run(cmd + ['--print-requires-private']).strip().split() + self.assertEqual(sorted(out), sorted(['libfoo'])) + + out = self._run(cmd + ['--cflags-only-other']).strip().split() + self.assertEqual(sorted(out), sorted(['-pthread', '-DCUSTOM'])) + + out = self._run(cmd + ['--libs-only-l', '--libs-only-other']).strip().split() + self.assertEqual(sorted(out), sorted(['-pthread', '-lcustom', + '-llibmain', '-llibexposed'])) + + out = self._run(cmd + ['--libs-only-l', '--libs-only-other', '--static']).strip().split() + self.assertEqual(sorted(out), sorted(['-pthread', '-lcustom', + '-llibmain', '-llibexposed', + '-llibinternal', '-lcustom2', + '-lfoo'])) + def test_vala_c_warnings(self): ''' Test that no warnings are emitted for C code generated by Vala. This -- cgit v1.1