From 569e646e1e3556fb5fdb7c4fb012a30145c7145d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 12 Feb 2019 15:51:46 -0800 Subject: dependencies: Add command line option for pkg_config_path This creates a new command line option to store pkg_config_path into, and store the environment variable into that option. Currently this works like the environment variable, for both cross and native targets. --- run_unittests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index bc28eea..34307f6 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -4837,9 +4837,9 @@ endian = 'little' testdir = os.path.join(self.unit_test_dir, '58 pkgconfig relative paths') pkg_dir = os.path.join(testdir, 'pkgconfig') self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'librelativepath.pc'))) - os.environ['PKG_CONFIG_PATH'] = pkg_dir env = get_fake_env(testdir, self.builddir, self.prefix) + env.coredata.set_options({'pkg_config_path': pkg_dir}, '') kwargs = {'required': True, 'silent': True} relative_path_dep = PkgConfigDependency('librelativepath', env, kwargs) self.assertTrue(relative_path_dep.found()) @@ -5068,6 +5068,11 @@ endian = 'little' # Assert that self.assertEqual(len(line.split(lib)), 2, msg=(lib, line)) + @skipIfNoPkgconfig + def test_pkg_config_option(self): + testdir = os.path.join(self.unit_test_dir, '55 pkg_config_path option') + self.init(testdir, extra_args=['-Dpkg_config_path=' + os.path.join(testdir, 'extra_path')]) + def should_run_cross_arm_tests(): return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm') -- cgit v1.1 From 91b2475e30d7659dad24eb35b47e4d098c716792 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 4 Apr 2019 15:48:54 -0700 Subject: dependencies/pkg-config: Add support for different cross_flags --- run_unittests.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 34307f6..97e5ef4 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5169,6 +5169,11 @@ class LinuxCrossMingwTests(BasePlatformTests): # Must run in-process or we'll get a generic CalledProcessError self.run_tests(inprocess=True) + @skipIfNoPkgconfig + def test_cross_pkg_config_option(self): + testdir = os.path.join(self.unit_test_dir, '55 pkg_config_path option') + self.init(testdir, extra_args=['-Dcross_pkg_config_path=' + os.path.join(testdir, 'extra_path')]) + class PythonTests(BasePlatformTests): ''' -- cgit v1.1