summaryrefslogtreecommitdiff
path: root/testsuite.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-09-19 07:06:17 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2017-09-19 07:29:33 +0200
commit4fce6c53e1bdac803c77f0be8bedece22d73c30c (patch)
tree7b22a9efadef8d7fba6dd957a50aa640b19c28e6 /testsuite.py
parent44a9a3df46782e40ae46ea2370db6ab06b49b3a0 (diff)
Include 'if' deps. in _determine_actual_symbols()
Previously, only WEIRD_1 and not WEIRD_2 would be considered not a choice symbol in the following fragment. This lead to a weird warning in U-Boot. choice config FOO config WEIRD_1 depends on FOO if FOO config WEIRD_2 endif endchoice Also add some testcases for weird choice symbols.
Diffstat (limited to 'testsuite.py')
-rw-r--r--testsuite.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/testsuite.py b/testsuite.py
index f1bbe9e..c8f504c 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -1672,8 +1672,8 @@ def run_selftests():
choice_bool, choice_bool_opt, choice_tristate, choice_tristate_opt, \
choice_bool_m, choice_tristate_m, choice_defaults, \
choice_no_type_bool, choice_no_type_tristate, \
- choice_missing_member_type_1, choice_missing_member_type_2 \
- = c.get_choices()
+ choice_missing_member_type_1, choice_missing_member_type_2, \
+ choice_weird_syms = c.get_choices()
for choice in (choice_bool, choice_bool_opt, choice_bool_m,
choice_defaults):
@@ -1805,6 +1805,29 @@ def run_selftests():
(kconfiglib.BOOL, kconfiglib.BOOL),
"Wrong types for second choice with missing member types")
+ # Verify that symbols in choices that depend on the preceding symbol aren't
+ # considered choice symbols
+
+ def verify_is_normal_choice_symbol(sym):
+ verify(sym.is_choice_symbol() and
+ sym in choice_weird_syms.get_symbols() and
+ sym.get_parent() is choice_weird_syms,
+ "{} should be a normal choice symbol".format(sym.get_name()))
+
+ def verify_is_weird_choice_symbol(sym):
+ verify(not sym.is_choice_symbol() and
+ sym not in choice_weird_syms.get_symbols() and
+ sym in choice_weird_syms.get_items() and
+ sym.get_parent() is choice_weird_syms,
+ "{} should be a weird (non-)choice symbol")
+
+ verify_is_normal_choice_symbol(c["WS1"])
+ verify_is_weird_choice_symbol(c["WS2"])
+ verify_is_weird_choice_symbol(c["WS3"])
+ verify_is_weird_choice_symbol(c["WS4"])
+ verify_is_normal_choice_symbol(c["WS5"])
+ verify_is_weird_choice_symbol(c["WS6"])
+
#
# Object dependencies
#