diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2025-07-19 09:22:50 +0200 |
|---|---|---|
| committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2025-07-19 23:43:53 +0530 |
| commit | 6c722589c946cb0bbd9536ac278f5726c0d05f63 (patch) | |
| tree | 50296e2a15484eb1c3e0f5801b55d2cc756ec624 | |
| parent | bf864662b6b7fa4ffed846fb9b3c76cba8fafc49 (diff) | |
| download | meson-6c722589c946cb0bbd9536ac278f5726c0d05f63.tar.gz | |
options: fix misindentation
Ensure that valobj.yielding is cleared for options in the toplevel project.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | mesonbuild/options.py | 2 | ||||
| -rw-r--r-- | unittests/optiontests.py | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/options.py b/mesonbuild/options.py index b2e64ca0b..988b4f34c 100644 --- a/mesonbuild/options.py +++ b/mesonbuild/options.py @@ -937,7 +937,7 @@ class OptionStore: # Subproject is set to yield, but top level # project does not have an option of the same pass - valobj.yielding = bool(valobj.parent) + valobj.yielding = bool(valobj.parent) self.options[key] = valobj self.project_options.add(key) diff --git a/unittests/optiontests.py b/unittests/optiontests.py index 94fefecb9..30e5f0313 100644 --- a/unittests/optiontests.py +++ b/unittests/optiontests.py @@ -121,6 +121,14 @@ class OptionTests(unittest.TestCase): self.assertEqual(optstore.get_value_for(name, 'sub'), sub_value) self.assertEqual(num_options(optstore), 2) + def test_toplevel_project_yielding(self): + optstore = OptionStore(False) + name = 'someoption' + top_value = 'top' + vo = UserStringOption(name, 'A top level option', top_value, True) + optstore.add_project_option(OptionKey(name, ''), vo) + self.assertEqual(optstore.get_value_for(name, ''), top_value) + def test_project_yielding(self): optstore = OptionStore(False) name = 'someoption' |
