[Concept,02/18] u_boot_pylib: Correct docs for run_test_coverage() required

Message ID 20250909151824.2327219-3-sjg@u-boot.org
State New
Headers
Series ulib: Complete initial U-Boot library |

Commit Message

Simon Glass Sept. 9, 2025, 3:17 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

This should be a set, not a list. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/u_boot_pylib/test_util.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Heinrich Schuchardt Sept. 10, 2025, 7:21 a.m. UTC | #1
On 9/9/25 17:17, Simon Glass wrote:
> From: Simon Glass <sjg@chromium.org>
> 
> This should be a set, not a list. Fix it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>   tools/u_boot_pylib/test_util.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py
> index d258a1935c9..7bd12705557 100644
> --- a/tools/u_boot_pylib/test_util.py
> +++ b/tools/u_boot_pylib/test_util.py
> @@ -36,7 +36,7 @@ def run_test_coverage(prog, filter_fname, exclude_list, build_dir,
>           exclude_list: List of file patterns to exclude from the coverage
>               calculation
>           build_dir: Build directory, used to locate libfdt.py
> -        required: List of modules which must be in the coverage report
> +        required: Set of modules which must be in the coverage report

This change looks inconsistent with the usage in the code:

line 81: missing_list = required

Required cannot be both a list and a set.

Best regards

Heinrich

>           extra_args (str): Extra arguments to pass to the tool before the -t/test
>               arg
>           single_thread (str): Argument string to make the tests run
  
Simon Glass Sept. 10, 2025, 9:46 a.m. UTC | #2
Hi Heinrich,

On Wed, 10 Sept 2025 at 01:21, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 9/9/25 17:17, Simon Glass wrote:
> > From: Simon Glass <sjg@chromium.org>
> >
> > This should be a set, not a list. Fix it.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >   tools/u_boot_pylib/test_util.py | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py
> > index d258a1935c9..7bd12705557 100644
> > --- a/tools/u_boot_pylib/test_util.py
> > +++ b/tools/u_boot_pylib/test_util.py
> > @@ -36,7 +36,7 @@ def run_test_coverage(prog, filter_fname, exclude_list, build_dir,
> >           exclude_list: List of file patterns to exclude from the coverage
> >               calculation
> >           build_dir: Build directory, used to locate libfdt.py
> > -        required: List of modules which must be in the coverage report
> > +        required: Set of modules which must be in the coverage report
>
> This change looks inconsistent with the usage in the code:
>
> line 81: missing_list = required
>
> Required cannot be both a list and a set.

Ah yes, that should really be renamed. I'll send a patch.

>
> Best regards
>
> Heinrich
>
> >           extra_args (str): Extra arguments to pass to the tool before the -t/test
> >               arg
> >           single_thread (str): Argument string to make the tests run
>

Regards,
SImon
  

Patch

diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py
index d258a1935c9..7bd12705557 100644
--- a/tools/u_boot_pylib/test_util.py
+++ b/tools/u_boot_pylib/test_util.py
@@ -36,7 +36,7 @@  def run_test_coverage(prog, filter_fname, exclude_list, build_dir,
         exclude_list: List of file patterns to exclude from the coverage
             calculation
         build_dir: Build directory, used to locate libfdt.py
-        required: List of modules which must be in the coverage report
+        required: Set of modules which must be in the coverage report
         extra_args (str): Extra arguments to pass to the tool before the -t/test
             arg
         single_thread (str): Argument string to make the tests run