From 058f89c2f2dc6ad86ca3806dd73c208c18128fe8 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 30 Sep 2019 10:44:59 -0400 Subject: Fix test_static_link() on MacOSX test3-static was actually always using the shared library because that warning was not fatal: WARNING: Static library 'func6' not found for dependency 'func6', may not be statically linked The reason why the libfunc6.a wasn't found is because the prefix in the generated pc file was not set to install dir. --- run_unittests.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/run_unittests.py b/run_unittests.py index d835ccd..a2b083f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5642,19 +5642,22 @@ c = ['{0}'] # Build some libraries and install them testdir = os.path.join(self.unit_test_dir, '69 static link/lib') - libdir = os.path.join(self.installdir, self.prefix[1:], self.libdir) + libdir = os.path.join(self.installdir, self.libdir) + oldprefix = self.prefix + self.prefix = self.installdir self.init(testdir) - self.install() + self.install(use_destdir=False) # Test that installed libraries works self.new_builddir() + self.prefix = oldprefix + meson_args = ['-Dc_link_args=-L{}'.format(libdir), + '--fatal-meson-warnings'] testdir = os.path.join(self.unit_test_dir, '69 static link') env = {'PKG_CONFIG_LIBDIR': os.path.join(libdir, 'pkgconfig')} - run_env = {'LD_LIBRARY_PATH': libdir} - self.init(testdir, extra_args=['-Dc_link_args="-L{}"'.format(libdir)], - override_envvars=env) + self.init(testdir, extra_args=meson_args, override_envvars=env) self.build() - self.run_tests(override_envvars=run_env) + self.run_tests() def should_run_cross_arm_tests(): return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm') -- cgit v1.1