Re: [PATCH 2/4] kconfig: tests: Provide defconfig outfile for savedefconfig
From: Nicolas Schier
Date: Thu Sep 24 2026 - 04:32:18 EST
On Sat, Sep 19, 2026 at 06:45:33PM +0100, Julian Braha wrote:
> 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>
thanks.
>
> > ---
> > 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).
Ah, yes. I'll update the argument of 'savedefconfig':
- def savedefconfig(self, dot_config):
+ def savedefconfig(self, dot_config, out_file='defconfig'):
Then out_file is properly defined. Thanks!
--
Nicolas