[PATCH 1/4] kconfig: tests: Reset KCONFIG_WARN_CHANGED_INPUT by default
From: Nicolas Schier
Date: Thu Sep 17 2026 - 10:24:57 EST
Reset KCONFIG_WARN_CHANGED_INPUT by default for all kconfig tests but
those which set it explicitly.
This fixes the 'warn_changed_input' test on systems with
KCONFIG_WARN_CHANGED_INPUT=1 and ensures a cleaner test environment.
Fixes: 645323a7f4e5 ("kconfig: add optional warnings for changed input values")
Signed-off-by: Nicolas Schier <n.schier@xxxxxxxxx>
---
scripts/kconfig/tests/conftest.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/kconfig/tests/conftest.py b/scripts/kconfig/tests/conftest.py
index 66f95e4ed58c..e92f0cf1421a 100644
--- a/scripts/kconfig/tests/conftest.py
+++ b/scripts/kconfig/tests/conftest.py
@@ -34,6 +34,9 @@ class Conf:
"""
# the directory of the test being run
self._test_dir = os.path.dirname(str(request.fspath))
+ self.default_env = {
+ "KCONFIG_WARN_CHANGED_INPUT": "",
+ }
# runners
def _run_conf(self, mode, dot_config=None, out_file='.config',
@@ -57,6 +60,11 @@ class Conf:
# Override 'srctree' environment to make the test as the top directory
extra_env['srctree'] = self._test_dir
+ # Set default environment variables, if not set by caller
+ for var in self.default_env:
+ if not var in extra_env:
+ extra_env[var] = self.default_env[var]
+
# Clear KCONFIG_DEFCONFIG_LIST to keep unit tests from being affected
# by the user's environment.
extra_env['KCONFIG_DEFCONFIG_LIST'] = ''
--
2.55.0