summaryrefslogtreecommitdiff
path: root/testsuite.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-11-02 20:36:41 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2017-11-02 20:38:26 +0100
commit852eae7d41abed9051f72d0ba72bfb854cfb6fcb (patch)
tree4f3213e1171d3ef242739039c32e02a9855ee73a /testsuite.py
parent72e7786599386ab2492ef06f1c2b72447addba45 (diff)
Clean up .kconfig tests
Kinda silly to test if they're separate since a long time, but can do that easily too with some reorganization.
Diffstat (limited to 'testsuite.py')
-rw-r--r--testsuite.py33
1 files changed, 12 insertions, 21 deletions
diff --git a/testsuite.py b/testsuite.py
index 156a640..3afa66a 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -1261,27 +1261,18 @@ g
verify_value("IGNOREME", "y")
- print("Testing Kconfig separation")
-
- c1 = Kconfig("Kconfiglib/tests/Kmisc", warn=False)
- c2 = Kconfig("Kconfiglib/tests/Kmisc", warn=False)
-
- c1_undef, c1_bool, c1_choice, c1_menu, c1_comment = c1.syms["BOOL"], \
- c1.syms["NOT_DEFINED_1"], get_choices(c1)[0], get_menus(c1)[0], \
- get_comments(c1)[0]
- c2_undef, c2_bool, c2_choice, c2_menu, c2_comment = c2.syms["BOOL"], \
- c2.syms["NOT_DEFINED_1"], get_choices(c2)[0], get_menus(c2)[0], \
- get_comments(c2)[0]
-
- verify((c1_undef is not c2_undef) and (c1_bool is not c2_bool) and
- (c1_choice is not c2_choice) and (c1_menu is not c2_menu) and
- (c1_comment is not c2_comment) and
- (c1_undef.kconfig is c1) and (c2_undef.kconfig is c2) and
- (c1_bool.kconfig is c1) and (c2_bool.kconfig is c2) and
- (c1_choice.kconfig is c1) and (c2_choice.kconfig is c2) and
- (c1_menu.kconfig is c1) and (c2_menu.kconfig is c2) and
- (c1_comment.kconfig is c1) and (c2_comment.kconfig is c2),
- "Config instance state separation or .config is broken")
+ print("Testing Kconfig fetching and separation")
+
+ for c in Kconfig("Kconfiglib/tests/Kmisc", warn=False), \
+ Kconfig("Kconfiglib/tests/Kmisc", warn=False):
+ for item in c.syms["BOOL"], \
+ c.syms["BOOL"].nodes[0], \
+ c.named_choices["OPTIONAL"], \
+ c.named_choices["OPTIONAL"].nodes[0], \
+ c.syms["MENU_HOOK"].nodes[0].next, \
+ c.syms["COMMENT_HOOK"].nodes[0].next:
+ verify(item.kconfig is c,
+ ".kconfig not properly set for " + repr(item))
print("Testing imply semantics")