-
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 visibility of tristate choice values in y choice
If tristate choice values depend on symbols set to 'm', they should be hidden when the choice containing them is changed from 'm' to 'y' (i.e. exclusive choice). This issue was fixed by commit fa64e5f ("kconfig/symbol.c: handle choice_values that depend on 'm' symbols"). Add a test case to avoid regression. For the input in this unit test, there is a room for argument if "# CONFIG_CHOICE1 is not set" should be written to the .config file. After commit fa64e5f, this line was written to the .config file. With commit cb67ab2 ("kconfig: do not write choice values when their dependency becomes n"), it is not written now. In this test, "# CONFIG_CHOICE1 is not set" is don't care. 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
930c429
commit ee23661
Showing
5 changed files
with
43 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,19 @@ | ||
config MODULES | ||
def_bool y | ||
option modules | ||
|
||
config DEP | ||
tristate | ||
default m | ||
|
||
choice | ||
prompt "Tristate Choice" | ||
|
||
config CHOICE0 | ||
tristate "Choice 0" | ||
|
||
config CHOICE1 | ||
tristate "Choice 1" | ||
depends on DEP | ||
|
||
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,15 @@ | ||
""" | ||
Hide tristate choice values with mod dependency in y choice. | ||
If tristate choice values depend on symbols set to 'm', they should be | ||
hidden when the choice containing them is changed from 'm' to 'y' | ||
(i.e. exclusive choice). | ||
Related Linux commit: fa64e5f6a35efd5e77d639125d973077ca506074 | ||
""" | ||
|
||
|
||
def test(conf): | ||
assert conf.oldaskconfig('config', 'y') == 0 | ||
assert conf.config_contains('expected_config') | ||
assert conf.stdout_contains('expected_stdout') |
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,2 @@ | ||
CONFIG_CHOICE0=m | ||
CONFIG_CHOICE1=m |
3 changes: 3 additions & 0 deletions
3
scripts/kconfig/tests/choice_value_with_m_dep/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,3 @@ | ||
CONFIG_MODULES=y | ||
CONFIG_DEP=m | ||
CONFIG_CHOICE0=y |
4 changes: 4 additions & 0 deletions
4
scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout
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,4 @@ | ||
Tristate Choice [M/y/?] y | ||
Tristate Choice | ||
> 1. Choice 0 (CHOICE0) | ||
choice[1]: 1 |