]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Allow easy importing of entry modules
authorSimon Glass <sjg@chromium.org>
Mon, 8 Jul 2019 20:25:32 +0000 (14:25 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Jul 2019 19:54:08 +0000 (12:54 -0700)
At present entry modules can only be accessed using Entry.Lookup() or
Entry.Create(). Most of the time this is fine, but sometimes a module
needs to provide constants or helper functions useful to other modules.
It is easier in this case to use 'import'.

Add an __init__ file to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/entry.py
tools/binman/etype/__init__.py [new file with mode: 0644]
tools/patman/test_util.py

index 00bb1d190a97841406584a8d22ef8753d891903b..a04e149d96c447994178a253d788965c5dc9fd41 100644 (file)
@@ -513,6 +513,8 @@ features to produce new behaviours.
             modules.remove('_testing')
         missing = []
         for name in modules:
+            if name.startswith('__'):
+                continue
             module = Entry.Lookup(name, name)
             docs = getattr(module, '__doc__')
             if test_missing == name:
diff --git a/tools/binman/etype/__init__.py b/tools/binman/etype/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 40098159c085d913e719cf7600eba59339b0cf23..09f258c26b4736b5784b05583347257074b42024 100644 (file)
@@ -58,6 +58,7 @@ def RunTestCoverage(prog, filter_fname, exclude_list, build_dir, required=None):
         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)))