aboutsummaryrefslogtreecommitdiff
path: root/unittests/optiontests.py
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/optiontests.py')
-rw-r--r--unittests/optiontests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/unittests/optiontests.py b/unittests/optiontests.py
index bbf9c0e..94d52ae 100644
--- a/unittests/optiontests.py
+++ b/unittests/optiontests.py
@@ -100,6 +100,22 @@ class OptionTests(unittest.TestCase):
self.assertEqual(optstore.get_value_for(name, 'sub'), top_value)
self.assertEqual(optstore.num_options(), 2)
+ def test_project_yielding_not_defined_in_top_project(self):
+ optstore = OptionStore(False)
+ top_name = 'a_name'
+ top_value = 'top'
+ sub_name = 'different_name'
+ sub_value = 'sub'
+ vo = UserStringOption(top_name, 'A top level option', top_value)
+ optstore.add_project_option(OptionKey(top_name, ''), vo)
+ self.assertEqual(optstore.get_value_for(top_name, ''), top_value)
+ self.assertEqual(optstore.num_options(), 1)
+ vo2 = UserStringOption(sub_name, 'A subproject option', sub_value, True)
+ optstore.add_project_option(OptionKey(sub_name, 'sub'), vo2)
+ self.assertEqual(optstore.get_value_for(top_name, ''), top_value)
+ self.assertEqual(optstore.get_value_for(sub_name, 'sub'), sub_value)
+ self.assertEqual(optstore.num_options(), 2)
+
def test_augments(self):
optstore = OptionStore(False)
name = 'cpp_std'