diff options
Diffstat (limited to 'unittests/machinefiletests.py')
-rw-r--r-- | unittests/machinefiletests.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/unittests/machinefiletests.py b/unittests/machinefiletests.py index b2839e6..7f88a54 100644 --- a/unittests/machinefiletests.py +++ b/unittests/machinefiletests.py @@ -550,8 +550,8 @@ class NativeFileTests(BasePlatformTests): # into augments. self.assertEqual(found, 2, 'Did not find all two sections') - def test_builtin_options_subprojects_overrides_buildfiles(self): - # If the buildfile says subproject(... default_library: shared), ensure that's overwritten + def test_builtin_options_machinefile_overrides_subproject(self): + # The buildfile says subproject(... default_library: static), the machinefile overrides it testcase = os.path.join(self.common_test_dir, '223 persubproject options') config = self.helper_create_native_file({'sub2:built-in options': {'default_library': 'shared'}}) @@ -563,11 +563,18 @@ class NativeFileTests(BasePlatformTests): check = cm.exception.stdout self.assertIn(check, 'Parent should override default_library') - def test_builtin_options_subprojects_dont_inherits_parent_override(self): - # If the buildfile says subproject(... default_library: shared), ensure that's overwritten + def test_builtin_options_machinefile_global_overrides_subproject(self): + # The buildfile says subproject(... default_library: static), ensure that's overridden testcase = os.path.join(self.common_test_dir, '223 persubproject options') config = self.helper_create_native_file({'built-in options': {'default_library': 'both'}}) - self.init(testcase, extra_args=['--native-file', config]) + + with self.assertRaises((RuntimeError, subprocess.CalledProcessError)) as cm: + self.init(testcase, extra_args=['--native-file', config]) + if isinstance(cm, RuntimeError): + check = str(cm.exception) + else: + check = cm.exception.stdout + self.assertIn(check, 'Parent should override default_library') def test_builtin_options_compiler_properties(self): # the properties section can have lang_args, and those need to be |