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,32 @@
# SPDX-License-Identifier: GPL-2.0
# Test Kconfig file for conditional dependencies.
# Enable module support for tristate testing
config MODULES
bool "Enable loadable module support"
modules
default y
config FOO
bool "FOO symbol"
config BAR
bool "BAR symbol"
config TEST_BASIC
bool "Test basic conditional dependency"
depends on FOO if BAR
default y
config TEST_COMPLEX
bool "Test complex conditional dependency"
depends on (FOO && BAR) if (FOO || BAR)
default y
config BAZ
tristate "BAZ symbol"
config TEST_OPTIONAL
tristate "Test simple optional dependency"
depends on BAZ if BAZ
default y
@@ -0,0 +1,14 @@
# SPDX-License-Identifier: GPL-2.0
"""
Correctly handle conditional dependencies.
"""
def test(conf):
assert conf.oldconfig('test_config1') == 0
assert conf.config_matches('expected_config1')
assert conf.oldconfig('test_config2') == 0
assert conf.config_matches('expected_config2')
assert conf.oldconfig('test_config3') == 0
assert conf.config_matches('expected_config3')
@@ -0,0 +1,11 @@
#
# Automatically generated file; DO NOT EDIT.
# Main menu
#
CONFIG_MODULES=y
CONFIG_FOO=y
CONFIG_BAR=y
CONFIG_TEST_BASIC=y
CONFIG_TEST_COMPLEX=y
CONFIG_BAZ=m
CONFIG_TEST_OPTIONAL=m
@@ -0,0 +1,9 @@
#
# Automatically generated file; DO NOT EDIT.
# Main menu
#
CONFIG_MODULES=y
# CONFIG_FOO is not set
CONFIG_BAR=y
CONFIG_BAZ=y
CONFIG_TEST_OPTIONAL=y
@@ -0,0 +1,11 @@
#
# Automatically generated file; DO NOT EDIT.
# Main menu
#
CONFIG_MODULES=y
# CONFIG_FOO is not set
# CONFIG_BAR is not set
CONFIG_TEST_BASIC=y
CONFIG_TEST_COMPLEX=y
# CONFIG_BAZ is not set
CONFIG_TEST_OPTIONAL=y
@@ -0,0 +1,6 @@
# Basic check that everything can be configured if selected.
CONFIG_FOO=y
CONFIG_BAR=y
CONFIG_BAZ=m
# Ensure that TEST_OPTIONAL=y with BAZ=m is converted to TEST_OPTIONAL=m
CONFIG_TEST_OPTIONAL=y
@@ -0,0 +1,7 @@
# If FOO is not selected, then TEST_BASIC should fail the conditional
# dependency since BAR is set.
# TEST_COMPLEX will fail dependency as it depends on both FOO and BAR
# if either of those is selected.
CONFIG_FOO=n
CONFIG_BAR=y
CONFIG_BAZ=y
@@ -0,0 +1,6 @@
# If FOO is not selected, but BAR is also not selected, then TEST_BASIC
# should pass since the dependency on FOO is conditional on BAR.
# TEST_COMPLEX should be also set since neither FOO nor BAR are selected
# so it has no dependencies.
CONFIG_FOO=n
CONFIG_BAR=n