diff options
5 files changed, 43 insertions, 0 deletions
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig b/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig new file mode 100644 index 000000000000..11ac25c26040 --- /dev/null +++ b/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig | |||
@@ -0,0 +1,19 @@ | |||
1 | config MODULES | ||
2 | def_bool y | ||
3 | option modules | ||
4 | |||
5 | config DEP | ||
6 | tristate | ||
7 | default m | ||
8 | |||
9 | choice | ||
10 | prompt "Tristate Choice" | ||
11 | |||
12 | config CHOICE0 | ||
13 | tristate "Choice 0" | ||
14 | |||
15 | config CHOICE1 | ||
16 | tristate "Choice 1" | ||
17 | depends on DEP | ||
18 | |||
19 | endchoice | ||
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py b/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py new file mode 100644 index 000000000000..f8d728c7b101 --- /dev/null +++ b/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py | |||
@@ -0,0 +1,15 @@ | |||
1 | """ | ||
2 | Hide tristate choice values with mod dependency in y choice. | ||
3 | |||
4 | If tristate choice values depend on symbols set to 'm', they should be | ||
5 | hidden when the choice containing them is changed from 'm' to 'y' | ||
6 | (i.e. exclusive choice). | ||
7 | |||
8 | Related Linux commit: fa64e5f6a35efd5e77d639125d973077ca506074 | ||
9 | """ | ||
10 | |||
11 | |||
12 | def test(conf): | ||
13 | assert conf.oldaskconfig('config', 'y') == 0 | ||
14 | assert conf.config_contains('expected_config') | ||
15 | assert conf.stdout_contains('expected_stdout') | ||
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/config b/scripts/kconfig/tests/choice_value_with_m_dep/config new file mode 100644 index 000000000000..3a126b7a2546 --- /dev/null +++ b/scripts/kconfig/tests/choice_value_with_m_dep/config | |||
@@ -0,0 +1,2 @@ | |||
1 | CONFIG_CHOICE0=m | ||
2 | CONFIG_CHOICE1=m | ||
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/expected_config b/scripts/kconfig/tests/choice_value_with_m_dep/expected_config new file mode 100644 index 000000000000..4d07b449540e --- /dev/null +++ b/scripts/kconfig/tests/choice_value_with_m_dep/expected_config | |||
@@ -0,0 +1,3 @@ | |||
1 | CONFIG_MODULES=y | ||
2 | CONFIG_DEP=m | ||
3 | CONFIG_CHOICE0=y | ||
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout b/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout new file mode 100644 index 000000000000..2b50ab65c86a --- /dev/null +++ b/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout | |||
@@ -0,0 +1,4 @@ | |||
1 | Tristate Choice [M/y/?] y | ||
2 | Tristate Choice | ||
3 | > 1. Choice 0 (CHOICE0) | ||
4 | choice[1]: 1 | ||