summaryrefslogtreecommitdiff
path: root/tests/Kstr
AgeCommit message (Collapse)Author
2019-05-25Use the '<type> "prompt"' shorthand in __str__()Ulf Magnusson
Pro: Looks cleaner and matches how definitions are usually written. Con: Makes it harder to discover that 'bool "foo"' is just shorthand for 'bool' + 'prompt "foo"' (though it's documented). The pros probably win.
2019-05-25Strip direct deps. from property conditions in Symbol/Choice/MenuNode.__str__()Ulf Magnusson
Commit e81a77b ("Consistently put direct deps. last when propagating") makes the position of the direct deps. in property conditions predictable after dependency propagation, making it easy to strip them as needed. Use this to implement MenuNode.orig_{prompt,defaults,selects,implies,ranges}, which work like the non-orig_* versions but omit the direct deps. Use those in turn to omit the direct deps in Symbol/Choice.__str__(). The direct deps. (with propagated parent deps.) can still be seen after 'depends on ...', so there is no loss of information. This unclutters Kconfig definitions shown in menuconfig/guiconfig and in any generated documentation. The old output also had duplicated dependencies, though it doesn't matter for evaluation. Before: config A bool prompt "A" if DEP default y if FOO && DEP depends on DEP After: config A bool prompt "A" default y if FOO depends on DEP
2019-05-24Consistently put direct deps. last when propagatingUlf Magnusson
Preparation for some later additions. Previously, the 'visible if' deps appeared to the right of the 'depends on' deps. Now, the direct deps always appear last. With this change, the prompt tuple is only updated once for any given menu node too, which should be a tiny bit faster.
2018-07-18Add def_int, def_hex, and def_string keywordsUlf Magnusson
Analogous to def_bool and def_tristate, setting the type and adding a default at the same time. This is a Kconfiglib extension. These keywords can be useful in projects that make use of symbols defined in multiple locations, and remove some Kconfig inconsistency.
2018-05-16Record which MenuNode has each propertyUlf Magnusson
This allows accurate documentation to be generated for symbols and choices defined in multiple locations. There are now MenuNode.defaults, MenuNode.selects, etc., lists that mirror the corresponding Symbol/Choice lists. Symbol/Choice.__str__() now correctly show property locations as well, by simply concatenating the strings returned by MenuNode.__str__() for each node. _parse_properties() was modified to add all properties directly to the menu node instead of adding them to the contained symbol or choice. The properties are then copied up to symbols and choices in _finalize_tree(). Dependency propagation is handled at the same time. As a side effect, this cleans up the code a bit and de-bloats _parse_properties(). Update the menuconfig implementation to use the new functionality. It now lists the menu nodes for symbols and choices with the correct properties for each node (previously, all defaults, selects, implies, and ranges appeared on the first definition).
2018-03-28Parenthesize && expressions within || expressionsUlf Magnusson
This is redundant from an evaluation perspective, as && has higher precedence than ||, but is easier to read. A && B || C && D is now rendered as "(A && B) || (C && D)".
2018-03-26Refactor expr_str() casesUlf Magnusson
- Detect Symbol directly instead of as (not tuple) + (not choice) - Test explicitly for a tuple (non-Symbol) in NOT - Add some tests to get better coverage for NOT and parentheses
2018-02-16Include direct deps. in Symbol/Choice.__str__()Ulf Magnusson
Direct dependencies are significant for 'imply' even if the symbol has no properties, so they need to be included to get semantically equivalent output. Making the direct dependencies clear is helpful in general too, even if you can usually infer them from the properties they get propagated to.
2017-11-02Get rid of separate is_optional testUlf Magnusson
The choice semantics tests already verify the behavior of optional choices. Just print an optional choice instead to get some coverage for querying it. Do minor cleanup elsewhere.
2017-10-28Add uncommitted test filesUlf Magnusson
2017-10-24Kconfiglib 2 backupUlf Magnusson
WIP