summaryrefslogtreecommitdiff
path: root/tests/Kchoice
blob: 1e841ca24e315ffd7ec75ceaf3a6ce763cb909ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
config MODULES
    bool "modules"

# bool/tristate and optional

choice BOOL
    bool "bool"
config B_1
    tristate "B_1"
config B_2
    tristate "B_2"
endchoice

choice BOOL_OPT
    bool "bool optional"
    optional
config BO_1
    tristate "BO_1"
config BO_2
    tristate "BO_2"
endchoice

choice TRISTATE
    tristate "tristate"
config T_1
    tristate "T_1"
config T_2
    tristate "T_2"
endchoice

choice TRISTATE_OPT
    tristate "tristate optional"
    optional
config TO_1
    tristate "TO_1"
config TO_2
    tristate "TO_2"
endchoice

# m-visibility

choice BOOL_M
    bool "bool m" if m
config BM_1
    tristate "BM_1"
config BM_2
    tristate "BM_2"
endchoice

choice TRISTATE_M
    tristate "tristate m" if m
config TM_1
    tristate "TM_1"
config TM_2
    tristate "TM_2"
endchoice

# Defaults

config TRISTATE_SYM
    tristate "tristate"

choice DEFAULTS
    bool "defaults"
    default OPT_1 if n
    default OPT_2 if TRISTATE_SYM
    default OPT_4
config OPT_1
    tristate "OPT_1"
config OPT_2
    tristate "OPT_2"
config OPT_3
    tristate "OPT_3"
config OPT_4
    tristate "OPT_4"
endchoice

# Choices without an explicitly specified type should get the type of the first
# symbol with a type

choice NO_TYPE_BOOL
    prompt "no type bool"
config NTB_1
    bool "NTB_1"
config NTB_2
    tristate "NTB_2"
endchoice

choice NO_TYPE_TRISTATE
    prompt "no type tristate"
config NTT_1
config NTT_2
    tristate "NTB_2"
config NTT_3
    bool "NTT_3"
endchoice

# Choice items without an explicitly specified type should get the type of the
# choice

choice MISSING_MEMBER_TYPES_1
    bool "missing member types"
config MMT_1
config MMT_2
config MMT_3
    tristate
endchoice

choice MISSING_MEMBER_TYPES_2
config MMT_4
config MMT_5
    bool
endchoice

# Choice with symbols that shouldn't be considered choice symbols because they
# depend on the preceding symbol. This might be a kconfig bug, but some things
# use it, so we need to emulate it.

choice WEIRD_SYMS
    bool "weird symbols that aren't considered part of the choice"

# Only WS1 is part of the choice
config WS1
config WS2
    depends on WS1
config WS3
    depends on WS2
config WS4
    depends on WS1

# 'if' has the same effect, so only WS5 is part of the choice
config WS5
if WS5
config WS6
endif

endchoice