diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-06-14 16:47:21 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-06-14 18:42:01 +0200 |
| commit | c8801514d63aaa6ad78ee62930ca5160fb52f74a (patch) | |
| tree | 853b826146d7c660eedd4b98a957fc90887bf7f1 /testsuite.py | |
| parent | 68043b21a2fdf09d91996977d5408e92a23fe3e8 (diff) | |
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").
Diffstat (limited to 'testsuite.py')
| -rw-r--r-- | testsuite.py | 30 |
1 files changed, 29 insertions, 1 deletions
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") |
