Re: [PATCH 2/4] kconfig: tests: Provide defconfig outfile for savedefconfig

From: Julian Braha

Date: Sat Sep 19 2026 - 13:45:43 EST


On 9/17/26 14:38, Nicolas Schier wrote:
> Let kconfig test framework's 'savedefconfig' forward the requested
> output 'defconfig' filename to 'conf'.
>
> The original implementation was calling 'conf' with '--savedefconfig'
> but missed the mandatory filename for the defconfig output file.
>
> While at it, honour the 'dot_config' argument which points to the input
> config file.
>
> Fixes: 022a4bf6b59d ("kconfig: tests: add framework for Kconfig unit testing")
> Signed-off-by: Nicolas Schier <n.schier@xxxxxxxxx>

Reviewed-by: Julian Braha <julianbraha@xxxxxxxxx>

> ---
> scripts/kconfig/tests/conftest.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/tests/conftest.py b/scripts/kconfig/tests/conftest.py
> index e92f0cf1421a..f2ad2ac2a661 100644
> --- a/scripts/kconfig/tests/conftest.py
> +++ b/scripts/kconfig/tests/conftest.py
> @@ -240,7 +240,8 @@ class Conf:
> dot_config: .config file for input
> returncode: exit status of the Kconfig executable
> """
> - return self._run_conf('--savedefconfig', out_file='defconfig')
> + return self._run_conf('--savedefconfig={}'.format(out_file),
> + dot_config=dot_config, out_file='defconfig')
>
> def listnewconfig(self, dot_config=None):
> """Run listnewconfig.
>

Nice catch!

<nitpick> out_file here isn't actually defined until later, in patch 4.
But it seems this won't actually break anything if applied alone since
this savedefconfig function currently isn't called anywhere (until your
patch 4).

- Julian Braha