[Concept] u_boot_pylib: Rename missing_list to missing_set

Message ID 20250910095404.4024784-1-sjg@u-boot.org
State New
Headers
Series [Concept] u_boot_pylib: Rename missing_list to missing_set |

Commit Message

Simon Glass Sept. 10, 2025, 9:54 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

The 'required' argument is a set so it is confusing to assign it to a
variable called 'missing_list'. Rename it to 'missing'.

Also document what happens if the parameter is None.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---

 tools/u_boot_pylib/test_util.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
  

Patch

diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py
index 7bd12705557..f0cf8ba2f93 100644
--- a/tools/u_boot_pylib/test_util.py
+++ b/tools/u_boot_pylib/test_util.py
@@ -36,7 +36,8 @@  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: Set of modules which must be in the coverage report
+        required (set of str): Set of modules which must be in the coverage
+            report. If None, then missing tests are not reported
         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
@@ -78,11 +79,11 @@  def run_test_coverage(prog, filter_fname, exclude_list, build_dir,
         # Convert '/path/to/name.py' just the module name 'name'
         test_set = set([os.path.splitext(os.path.basename(line.split()[0]))[0]
                         for line in lines if '/etype/' in line])
-        missing_list = required
-        missing_list.discard('__init__')
-        missing_list.difference_update(test_set)
-        if missing_list:
-            print('Missing tests for %s' % (', '.join(missing_list)))
+        missing = required
+        missing.discard('__init__')
+        missing.difference_update(test_set)
+        if missing:
+            print('Missing tests for %s' % (', '.join(missing)))
             print(stdout)
             ok = False