linux/scripts/kconfig/tests
Pengpeng Hou 645323a7f4
kconfig: add optional warnings for changed input values
When reading .config input, Kconfig stores user-provided values first
and then resolves the final value after applying dependencies, ranges,
and other constraints.

If the final value differs from the user input, Kconfig already tracks
that state internally, but it does not provide a focused diagnostic to
show which explicit inputs were adjusted. This is particularly confusing
for requested values that get forced down by unmet dependencies or
clamped by ranges.

Add an opt-in diagnostic controlled by KCONFIG_WARN_CHANGED_INPUT. Emit
the warnings from conf_write() and conf_write_defconfig() after value
resolution. Print the diagnostic to stderr directly, not through the
normal message callback, so it remains visible when conf is run with -s,
such as from make -s.

Keep the diagnostic out of the conf_message() formatting buffer so long
warning lists are not truncated, and mark processed symbols as written
before the SYMBOL_WRITE check so duplicate menu nodes cannot emit
duplicate warnings.

Document the new environment variable and add tests for olddefconfig,
savedefconfig, and the silent-conf path.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Tested-by: Julian Braha <julianbraha@gmail.com>
Link: https://patch.msgid.link/20260611060000.23858-1-pengpeng@iscas.ac.cn
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2026-06-18 11:46:32 -07:00
..
auto_submenu
choice kconfig: remove tristate choice support 2024-07-16 01:08:36 +09:00
choice_randomize kconfig: tests: add a test for randconfig with dependent choices 2024-03-21 02:39:55 +09:00
choice_randomize2 kconfig: tests: test dependency after shuffling choices 2024-03-21 02:40:39 +09:00
conditional_dep kconfig: Support conditional deps using "depends on X if Y" 2026-01-06 14:57:15 -07:00
err_recursive_dep kconfig: recursive checks drop file/lineno 2024-07-20 16:33:45 +09:00
err_recursive_inc
err_repeated_inc kconfig: Error out on duplicated kconfig inclusion 2026-02-27 09:26:58 +01:00
err_transitional kconfig: Add transitional symbol attribute for migration support 2025-09-24 14:23:35 -07:00
new_choice_with_dep
no_write_if_dep_unmet kconfig: tests: fix typo in comment 2026-06-09 16:28:46 -07:00
preprocess
transitional kconfig: Avoid prompting for transitional symbols 2025-10-07 08:21:23 -07:00
warn_changed_input kconfig: add optional warnings for changed input values 2026-06-18 11:46:32 -07:00
conftest.py kconfig: add optional warnings for changed input values 2026-06-18 11:46:32 -07:00
pytest.ini