|
|
|
@ -9325,13 +9325,15 @@ class CrossFileTests(BasePlatformTests): |
|
|
|
|
|
|
|
|
|
def test_builtin_options_conf_overrides_env(self): |
|
|
|
|
testcase = os.path.join(self.common_test_dir, '2 cpp') |
|
|
|
|
config = self.helper_create_cross_file({'built-in options': {'pkg_config_path': '/native'}}) |
|
|
|
|
cross = self.helper_create_cross_file({'built-in options': {'pkg_config_path': '/cross'}}) |
|
|
|
|
config = self.helper_create_cross_file({'built-in options': {'pkg_config_path': '/native', 'cpp_args': '-DFILE'}}) |
|
|
|
|
cross = self.helper_create_cross_file({'built-in options': {'pkg_config_path': '/cross', 'cpp_args': '-DFILE'}}) |
|
|
|
|
|
|
|
|
|
self.init(testcase, extra_args=['--native-file', config, '--cross-file', cross], |
|
|
|
|
override_envvars={'PKG_CONFIG_PATH': '/bar', 'PKG_CONFIG_PATH_FOR_BUILD': '/dir'}) |
|
|
|
|
override_envvars={'PKG_CONFIG_PATH': '/bar', 'PKG_CONFIG_PATH_FOR_BUILD': '/dir', |
|
|
|
|
'CXXFLAGS': '-DENV', 'CXXFLAGS_FOR_BUILD': '-DENV'}) |
|
|
|
|
configuration = self.introspect('--buildoptions') |
|
|
|
|
found = 0 |
|
|
|
|
expected = 4 |
|
|
|
|
for each in configuration: |
|
|
|
|
if each['name'] == 'pkg_config_path': |
|
|
|
|
self.assertEqual(each['value'], ['/cross']) |
|
|
|
@ -9339,6 +9341,29 @@ class CrossFileTests(BasePlatformTests): |
|
|
|
|
elif each['name'] == 'build.pkg_config_path': |
|
|
|
|
self.assertEqual(each['value'], ['/native']) |
|
|
|
|
found += 1 |
|
|
|
|
elif each['name'].endswith('cpp_args'): |
|
|
|
|
self.assertEqual(each['value'], ['-DFILE']) |
|
|
|
|
found += 1 |
|
|
|
|
if found == expected: |
|
|
|
|
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.') |
|
|
|
|