]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Rename the main module
authorSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2020 00:08:58 +0000 (18:08 -0600)
committerSimon Glass <sjg@chromium.org>
Sun, 26 Apr 2020 20:25:21 +0000 (14:25 -0600)
Python does not like the module name being the same as the module
directory. To allow buildman modules to be used from other tools, rename
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/binman
tools/binman/ftest.py
tools/binman/main.py [moved from tools/binman/binman.py with 98% similarity]
tools/patman/test_util.py

index 979b7e4d4b8fdd0bfeda53b04edf141cbf22149c..11a5d8e18ab71465be9424cf930c5e792c75edb7 120000 (symlink)
@@ -1 +1 @@
-binman.py
\ No newline at end of file
+main.py
\ No newline at end of file
index 67f976e5d0665e34a8aac23d84e554764a7d2973..0e2b50771e9fecf994e7d531f593d0a55611a929 100644 (file)
@@ -15,7 +15,7 @@ import sys
 import tempfile
 import unittest
 
-import binman
+import main
 import cbfs_util
 import cmdline
 import command
@@ -1428,14 +1428,14 @@ class TestFunctional(unittest.TestCase):
     def testEntryDocs(self):
         """Test for creation of entry documentation"""
         with test_util.capture_sys_output() as (stdout, stderr):
-            control.WriteEntryDocs(binman.GetEntryModules())
+            control.WriteEntryDocs(main.GetEntryModules())
         self.assertTrue(len(stdout.getvalue()) > 0)
 
     def testEntryDocsMissing(self):
         """Test handling of missing entry documentation"""
         with self.assertRaises(ValueError) as e:
             with test_util.capture_sys_output() as (stdout, stderr):
-                control.WriteEntryDocs(binman.GetEntryModules(), 'u_boot')
+                control.WriteEntryDocs(main.GetEntryModules(), 'u_boot')
         self.assertIn('Documentation is missing for modules: u_boot',
                       str(e.exception))
 
similarity index 98%
rename from tools/binman/binman.py
rename to tools/binman/main.py
index ec152e9b3bdc92abec52b72cf4b6e3fd90d5bf5d..daff7ae4d3fe446ccd7833cfdbac15929c32168b 100755 (executable)
@@ -155,8 +155,8 @@ def RunTestCoverage():
     glob_list = GetEntryModules(False)
     all_set = set([os.path.splitext(os.path.basename(item))[0]
                    for item in glob_list if '_testing' not in item])
-    test_util.RunTestCoverage('tools/binman/binman.py', None,
-            ['*test*', '*binman.py', 'tools/patman/*', 'tools/dtoc/*'],
+    test_util.RunTestCoverage('tools/binman/binman', None,
+            ['*test*', '*main.py', 'tools/patman/*', 'tools/dtoc/*'],
             args.build_dir, all_set)
 
 def RunBinman(args):
index 4d0085e2ed4de21f63b6911b8085778e78d95438..76dbc21e3a4601747717a7558aea65f37a0f2f58 100644 (file)
@@ -41,7 +41,7 @@ def RunTestCoverage(prog, filter_fname, exclude_list, build_dir, required=None):
         glob_list = []
     glob_list += exclude_list
     glob_list += ['*libfdt.py', '*site-packages*', '*dist-packages*']
-    test_cmd = 'test' if 'binman.py' in prog else '-t'
+    test_cmd = 'test' if 'binman' in prog else '-t'
     cmd = ('PYTHONPATH=$PYTHONPATH:%s/sandbox_spl/tools %s-coverage run '
            '--omit "%s" %s %s -P1' % (build_dir, PYTHON, ','.join(glob_list),
                                       prog, test_cmd))