[PATCH v4 2/3] buildman: unit test for configuration fragments

Simon Glass sjg at chromium.org
Fri Apr 18 13:39:37 CEST 2025


Hi Heinrich,

On Thu, 17 Apr 2025 at 22:31, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> Check that configuration fragments provided to buildman as comma
> separated list are passed on to the make command of the builder.

common-separated

and below too


>
> In the %_defconfig: target of scripts/kconfig/Makefile the defconfig
> file and the fragments are combined via the gcc preprocessor.
> Modeling this step in the buildman testbench without invoking the actual
> Makefile would not provide better test coverage.
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
> v4:
>         no change
> v3:
>         no change
> v2:
>         new patch
> ---
>  tools/buildman/func_test.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
> index b45eb95a1e6..95b51af0249 100644
> --- a/tools/buildman/func_test.py
> +++ b/tools/buildman/func_test.py
> @@ -798,6 +798,21 @@ Some images are invalid'''
>          lines = self.check_command('-L')[0]
>          self.assertIn(b'NO_LTO=1', lines[0])
>
> +    def testFragments(self):
> +        """Test passing of configuration fragments to the make command"""
> +        # Single fragment passed as argument
> +        extra_args = ['board0', '--fragments', 'f1.config']
> +        lines, cfg_data = self.check_command(*extra_args)
> +        self.assertRegex(lines[0].decode('utf-8'),
> +                         r'make O=/.*board0_defconfig\s+f1\.config',
> +                         'Test single fragment')
> +        # Multiple fragments passed as comma separated list
> +        extra_args = ['board0', '--fragments', 'f1.config,f2.config']
> +        lines, cfg_data = self.check_command(*extra_args)
> +        self.assertRegex(lines[0].decode('utf-8'),
> +                         r'make O=/.*board0_defconfig\s+f1\.config\s+f2\.config',
> +                         'Test multiple fragments')
> +
>      def testReproducible(self):
>          """Test that the -r flag works"""
>          lines, cfg_data = self.check_command('-r')
> --
> 2.48.1
>


More information about the U-Boot mailing list