-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kconfig: tests: check unneeded "is not set" with unmet dependency
Commit cb67ab2 ("kconfig: do not write choice values when their dependency becomes n") fixed a problem where "# CONFIG_... is not set" for choice values are wrongly written into the .config file when they are once visible, then become invisible later. Add a test for this naive case. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
- Loading branch information
Masahiro Yamada
committed
Mar 25, 2018
1 parent
b76960c
commit 930c429
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
config A | ||
bool "A" | ||
|
||
choice | ||
prompt "Choice ?" | ||
depends on A | ||
|
||
config CHOICE_B | ||
bool "Choice B" | ||
|
||
config CHOICE_C | ||
bool "Choice C" | ||
|
||
endchoice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
Do not write choice values to .config if the dependency is unmet. | ||
"# CONFIG_... is not set" should not be written into the .config file | ||
for symbols with unmet dependency. | ||
This was not working correctly for choice values because choice needs | ||
a bit different symbol computation. | ||
This checks that no unneeded "# COFIG_... is not set" is contained in | ||
the .config file. | ||
Related Linux commit: cb67ab2cd2b8abd9650292c986c79901e3073a59 | ||
""" | ||
|
||
|
||
def test(conf): | ||
assert conf.oldaskconfig('config', 'n') == 0 | ||
assert conf.config_matches('expected_config') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_A=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# Automatically generated file; DO NOT EDIT. | ||
# Linux Kernel Configuration | ||
# | ||
# CONFIG_A is not set |