summaryrefslogtreecommitdiff
path: root/tools/binman/main.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-08-05 13:27:46 -0600
committerSimon Glass <sjg@chromium.org>2020-08-22 08:53:38 -0600
commit87d43329ef7698eab5b090a91228269c39643122 (patch)
tree9440be9be37be55fee8329b841253dbf0317685e /tools/binman/main.py
parent702e57e113d85fef60ebe9e5c87194414666cfac (diff)
downloadu-boot-87d43329ef7698eab5b090a91228269c39643122.tar.gz
u-boot-87d43329ef7698eab5b090a91228269c39643122.tar.bz2
u-boot-87d43329ef7698eab5b090a91228269c39643122.zip
binman: Move GetEntryModules() to control
When binman is installed its main program is in a different directory to its modules. This means that __file__ is different and we cannot use it to obtain the path to etype/ from main.py To fix this, move the function to the 'control' module, since it is installed with all the other modules, including the etype/ directory. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/main.py')
-rwxr-xr-xtools/binman/main.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/tools/binman/main.py b/tools/binman/main.py
index e543a7d06a..3e463b0119 100755
--- a/tools/binman/main.py
+++ b/tools/binman/main.py
@@ -10,7 +10,6 @@
"""See README for more information"""
from distutils.sysconfig import get_python_lib
-import glob
import os
import site
import sys
@@ -78,20 +77,9 @@ def RunTests(debug, verbosity, processes, test_preserve_dirs, args, toolpath):
return test_util.ReportResult('binman', test_name, result)
-def GetEntryModules(include_testing=True):
- """Get a set of entry class implementations
-
- Returns:
- Set of paths to entry class filenames
- """
- glob_list = glob.glob(os.path.join(our_path, 'etype/*.py'))
- return set([os.path.splitext(os.path.basename(item))[0]
- for item in glob_list
- if include_testing or '_testing' not in item])
-
def RunTestCoverage(toolpath):
"""Run the tests and check that we get 100% coverage"""
- glob_list = GetEntryModules(False)
+ glob_list = control.GetEntryModules(False)
all_set = set([os.path.splitext(os.path.basename(item))[0]
for item in glob_list if '_testing' not in item])
extra_args = ''
@@ -127,7 +115,7 @@ def RunBinman(args):
args.toolpath)
elif args.cmd == 'entry-docs':
- control.WriteEntryDocs(GetEntryModules())
+ control.WriteEntryDocs(control.GetEntryModules())
else:
try: