CONFIGURATION!

This commit is contained in:
2026-08-05 18:25:17 +02:00
parent 770c7ca631
commit ffaf8f258e
155 changed files with 28575 additions and 19 deletions
@@ -0,0 +1,22 @@
choice
prompt "choose A or B"
config A
bool "A"
config B
bool "B"
endchoice
choice
prompt "choose X or Y"
depends on B
config X
bool "X"
config Y
bool "Y"
endchoice
@@ -0,0 +1,34 @@
# SPDX-License-Identifier: GPL-2.0-only
"""
Randomize all dependent choices
This is a somewhat tricky case for randconfig; the visibility of one choice is
determined by a member of another choice. Randconfig should be able to generate
all possible patterns.
"""
def test(conf):
expected0 = False
expected1 = False
expected2 = False
for i in range(100):
assert conf.randconfig(seed=i) == 0
if conf.config_matches('expected_config0'):
expected0 = True
elif conf.config_matches('expected_config1'):
expected1 = True
elif conf.config_matches('expected_config2'):
expected2 = True
else:
assert False
if expected0 and expected1 and expected2:
break
assert expected0
assert expected1
assert expected2
@@ -0,0 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Main menu
#
CONFIG_A=y
# CONFIG_B is not set
@@ -0,0 +1,8 @@
#
# Automatically generated file; DO NOT EDIT.
# Main menu
#
# CONFIG_A is not set
CONFIG_B=y
CONFIG_X=y
# CONFIG_Y is not set
@@ -0,0 +1,8 @@
#
# Automatically generated file; DO NOT EDIT.
# Main menu
#
# CONFIG_A is not set
CONFIG_B=y
# CONFIG_X is not set
CONFIG_Y=y