From 37b122b87e716f5a4e909db12a7793d162c599bb Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 16 Nov 2021 00:11:48 +0530 Subject: unit tests: Don't check quoting with multiple libs pkgconf has a bug on MSYS2 due to which prefixes with spaces are not handled correctly if the library has a Requires: on another library and both have prefixes with spaces in them. See: https://github.com/pkgconf/pkgconf/issues/238 So move the unit test to libanswer.pc instead of libfoo.pc till that is fixed. --- test cases/common/44 pkgconfig-gen/meson.build | 1 + unittests/allplatformstests.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test cases/common/44 pkgconfig-gen/meson.build b/test cases/common/44 pkgconfig-gen/meson.build index 5e9141f..128205a 100644 --- a/test cases/common/44 pkgconfig-gen/meson.build +++ b/test cases/common/44 pkgconfig-gen/meson.build @@ -47,6 +47,7 @@ answerlib = shared_library('answer', 'answer.c') pkgg.generate(answerlib, name : 'libanswer', description : 'An answer library.', + extra_cflags : ['-DLIBFOO'], ) # Test that name_prefix='' and name='libfoo' results in '-lfoo' diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 7437d78..b176aa5 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -1592,10 +1592,10 @@ class AllPlatformTests(BasePlatformTests): os.environ['PKG_CONFIG_LIBDIR'] = self.privatedir env = get_fake_env(testdir, self.builddir, self.prefix) kwargs = {'required': True, 'silent': True} - foo_dep = PkgConfigDependency('libfoo', env, kwargs) + foo_dep = PkgConfigDependency('libanswer', env, kwargs) # Ensure link_args are properly quoted libdir = PurePath(prefix) / PurePath(libdir) - link_args = ['-L' + libdir.as_posix(), '-lfoo', '-lanswer'] + link_args = ['-L' + libdir.as_posix(), '-lanswer'] self.assertEqual(foo_dep.get_link_args(), link_args) # Ensure include args are properly quoted incdir = PurePath(prefix) / PurePath('include') -- cgit v1.1