From 2259d353426f12d5fa807075fb4727e64331ac8a Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 4 Apr 2018 16:20:58 +0200 Subject: 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. --- testsuite.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'testsuite.py') 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" -- cgit v1.2.3