summaryrefslogtreecommitdiff
path: root/testsuite.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-04-04 16:20:58 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-04-04 16:44:58 +0200
commit2259d353426f12d5fa807075fb4727e64331ac8a (patch)
tree4d1cfdee3afc652562a06f02ac28a58984082ef4 /testsuite.py
parent7245bad9ebb58fc8ce5a322081fc6c39d2dc59c6 (diff)
Generalize is_menuconfig to non-symbol items
Extending the scope of is_menuconfig so that it's True for all items whose children should be displayed in a separate menu turns out to be handy when implementing menuconfig-like functionality. Keep the old name for backwards compatibility. It's good enough.
Diffstat (limited to 'testsuite.py')
-rw-r--r--testsuite.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite.py b/testsuite.py
index 5d8780e..0378730 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -1302,6 +1302,27 @@ g
format(s.name))
+ print("Testing is_menuconfig")
+
+ c = Kconfig("Kconfiglib/tests/Kmenuconfig")
+
+ for not_menuconfig in c.syms["NOT_MENUCONFIG_1"].nodes[0], \
+ c.syms["NOT_MENUCONFIG_2"].nodes[0], \
+ c.syms["MENUCONFIG_MULTI_DEF"].nodes[0], \
+ c.syms["COMMENT_HOOK"].nodes[0].next:
+
+ verify(not not_menuconfig.is_menuconfig,
+ "'{}' should have is_menuconfig False".format(not_menuconfig))
+
+ for menuconfig in c.syms["MENUCONFIG_1"].nodes[0], \
+ c.syms["MENUCONFIG_MULTI_DEF"].nodes[1], \
+ c.syms["MENU_HOOK"].nodes[0].next, \
+ c.syms["CHOICE_HOOK"].nodes[0].next:
+
+ verify(menuconfig.is_menuconfig,
+ "'{}' should have is_menuconfig True".format(menuconfig))
+
+
print("Testing 'option env' semantics")
os.environ["ENV_VAR"] = "ENV_VAR value"