From c8801514d63aaa6ad78ee62930ca5160fb52f74a Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 14 Jun 2018 16:47:21 +0200 Subject: Fix incorrectly ordered properties for some nested multi.def. symbols _propagate_deps() visits menu nodes roughly breadth-first, meaning properties on symbols and choices defined in multiple locations could end up in the wrong order when copied from the menu node for some unlucky if/menu nestings. Fix it by moving the menu-node-to-symbol/choice property copying in _finalize_tree() so that it's guaranteed to happen in definition order. This bug was introduced by commit 63a4418 ("Record which MenuNode has each property"). --- testsuite.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index 5c12bc0..c773b99 100644 --- a/testsuite.py +++ b/testsuite.py @@ -1022,7 +1022,7 @@ g verify_deps(c.syms["JUST_DEPENDS_ON_REFS"].nodes[0], "A", "B") verify_deps(c.syms["LOTS_OF_REFS"].nodes[0], - *(chr(n) for n in range(ord('A'), ord('Z') + 1))) + *(chr(n) for n in range(ord("A"), ord("Z") + 1))) verify_deps(c.syms["INT_REFS"].nodes[0], "A", "B", "C", "D", "E", "F", "G", "H", "y") @@ -1945,6 +1945,34 @@ g verify_is_normal_choice_symbol("WS9") + print("Testing multi.def. property copying") + + c = Kconfig("Kconfiglib/tests/Kdepcopy", warn=False) + + def verify_props(desc, props, prop_names): + actual = [prop[0].name for prop in props] + expected = prop_names.split() + + verify(actual == expected, + "Wrong {} properties, expected '{}', got '{}'" + .format(desc, expected, actual)) + + verify_props("default", c.syms["MULTIDEF"].defaults, + "A B C D E F G H I J K L M N O P Q R") + + verify_props("select", c.syms["MULTIDEF"].selects, + "AA BB CC DD EE FF GG HH II JJ") + + verify_props("imply", c.syms["MULTIDEF"].selects, + "AA BB CC DD EE FF GG HH II JJ") + + verify_props("select", c.syms["MULTIDEF_CHOICE"].selects, + "A B C") + + verify_props("range", c.syms["MULTIDEF_RANGE"].ranges, + "A B C D E F") + + print("\nAll selftests passed\n" if all_passed else "\nSome selftests failed\n") -- cgit v1.2.3