Loading...
1# SPDX-License-Identifier: GPL-2.0
2"""
3Basic choice tests.
4
5The handling of 'choice' is a bit complicated part in Kconfig.
6
7The behavior of 'y' choice is intuitive. If choice values are tristate,
8the choice can be 'm' where each value can be enabled independently.
9Also, if a choice is marked as 'optional', the whole choice can be
10invisible.
11"""
12
13
14def test_oldask0(conf):
15 assert conf.oldaskconfig() == 0
16 assert conf.stdout_contains('oldask0_expected_stdout')
17
18
19def test_oldask1(conf):
20 assert conf.oldaskconfig('oldask1_config') == 0
21 assert conf.stdout_contains('oldask1_expected_stdout')
22
23
24def test_allyes(conf):
25 assert conf.allyesconfig() == 0
26 assert conf.config_contains('allyes_expected_config')
27
28
29def test_allmod(conf):
30 assert conf.allmodconfig() == 0
31 assert conf.config_contains('allmod_expected_config')
32
33
34def test_allno(conf):
35 assert conf.allnoconfig() == 0
36 assert conf.config_contains('allno_expected_config')
37
38
39def test_alldef(conf):
40 assert conf.alldefconfig() == 0
41 assert conf.config_contains('alldef_expected_config')
1"""
2Basic choice tests.
3
4The handling of 'choice' is a bit complicated part in Kconfig.
5
6The behavior of 'y' choice is intuitive. If choice values are tristate,
7the choice can be 'm' where each value can be enabled independently.
8Also, if a choice is marked as 'optional', the whole choice can be
9invisible.
10"""
11
12
13def test_oldask0(conf):
14 assert conf.oldaskconfig() == 0
15 assert conf.stdout_contains('oldask0_expected_stdout')
16
17
18def test_oldask1(conf):
19 assert conf.oldaskconfig('oldask1_config') == 0
20 assert conf.stdout_contains('oldask1_expected_stdout')
21
22
23def test_allyes(conf):
24 assert conf.allyesconfig() == 0
25 assert conf.config_contains('allyes_expected_config')
26
27
28def test_allmod(conf):
29 assert conf.allmodconfig() == 0
30 assert conf.config_contains('allmod_expected_config')
31
32
33def test_allno(conf):
34 assert conf.allnoconfig() == 0
35 assert conf.config_contains('allno_expected_config')
36
37
38def test_alldef(conf):
39 assert conf.alldefconfig() == 0
40 assert conf.config_contains('alldef_expected_config')