aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-31 19:11:57 +0200
committerGitHub <noreply@github.com>2017-12-31 19:11:57 +0200
commitdd3f49af0d8c94033e6db68b25c23ea9e63e9c5c (patch)
treecfae667dcb4b0ad3266d47134354636a1f3ba059 /run_unittests.py
parent500c39cb07d21aa6857e204f6689d324afd758c4 (diff)
parent68eedc8b7157190a010d31bea81f13f91144ea75 (diff)
downloadmeson-dd3f49af0d8c94033e6db68b25c23ea9e63e9c5c.zip
meson-dd3f49af0d8c94033e6db68b25c23ea9e63e9c5c.tar.gz
meson-dd3f49af0d8c94033e6db68b25c23ea9e63e9c5c.tar.bz2
Merge pull request #2757 from xclaesse/pkgconfig
pkgconfig: Allow passing Dependency objects to library(_private)
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 61ee770..184386c 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2010,6 +2010,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