summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-06-10 14:58:58 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-06-18 21:33:19 +0300
commit9b1eb8b8ed434d1c2fdca0d8ac46b79c9b91bb0f (patch)
treee789a9a6b881e49d52b278f8f57d78b0631ef22b /unittests
parente284c0d74240da15e7d62d3d530c69b224130be6 (diff)
downloadmeson-9b1eb8b8ed434d1c2fdca0d8ac46b79c9b91bb0f.tar.gz
test cases: do not pass global option on command line
The test covers overriding an option from the dependency() function. If the same option is passed on the command line, it overrides the dependency()'s default_options as well. Tweak the description of the unittests that uses the same sources. The tests pass, but I am not sure they should. For example in the second test the default_library=both setting in the machine file should have the same effect as the -D option (machine files have lower priority than command line, but higher priority than anything in meson.build files). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'unittests')
-rw-r--r--unittests/machinefiletests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/unittests/machinefiletests.py b/unittests/machinefiletests.py
index b2839e6b2..1c65c0ceb 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,8 +563,9 @@ 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_loses_over_subproject(self):
+ # The buildfile says subproject(... default_library: static), ensure that it overrides the machinefile
+ # FIXME: Should it??
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])