diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-03-30 10:27:54 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-04-04 00:13:39 +0530 |
commit | ca2bf239e3d1bea0f2c68f22c8223be44ddcb368 (patch) | |
tree | 1520be4243526b512a9f870f8da83ac7cacdfde0 | |
parent | 3e6578ad349dcb78c56527e142f428a683bce8bc (diff) | |
download | meson-ca2bf239e3d1bea0f2c68f22c8223be44ddcb368.zip meson-ca2bf239e3d1bea0f2c68f22c8223be44ddcb368.tar.gz meson-ca2bf239e3d1bea0f2c68f22c8223be44ddcb368.tar.bz2 |
tests: Add a test for the _FOR_BUILD env vars
-rwxr-xr-x | run_unittests.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index f9a925f..e3fea39 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -9237,6 +9237,26 @@ class CrossFileTests(BasePlatformTests): break self.assertEqual(found, expected, 'Did not find all sections.') + def test_for_build_env_vars(self) -> None: + testcase = os.path.join(self.common_test_dir, '2 cpp') + config = self.helper_create_cross_file({'built-in options': {}}) + cross = self.helper_create_cross_file({'built-in options': {}}) + + self.init(testcase, extra_args=['--native-file', config, '--cross-file', cross], + override_envvars={'PKG_CONFIG_PATH': '/bar', 'PKG_CONFIG_PATH_FOR_BUILD': '/dir'}) + configuration = self.introspect('--buildoptions') + found = 0 + for each in configuration: + if each['name'] == 'pkg_config_path': + self.assertEqual(each['value'], ['/bar']) + found += 1 + elif each['name'] == 'build.pkg_config_path': + self.assertEqual(each['value'], ['/dir']) + found += 1 + if found == 2: + break + self.assertEqual(found, 2, 'Did not find all sections.') + class TAPParserTests(unittest.TestCase): def assert_test(self, events, **kwargs): |