[PATCH 11/17] patman: Convert camel case in test_util.py

Simon Glass sjg at chromium.org
Sat Jan 29 22:14:14 CET 2022


Convert this file to snake case and update all files which use it.

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

 tools/binman/main.py      | 6 +++---
 tools/dtoc/main.py        | 6 +++---
 tools/dtoc/test_fdt.py    | 2 +-
 tools/patman/main.py      | 2 +-
 tools/patman/test_util.py | 6 +++---
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/tools/binman/main.py b/tools/binman/main.py
index 03462e7bb8b..ab25b48b5fb 100755
--- a/tools/binman/main.py
+++ b/tools/binman/main.py
@@ -84,14 +84,14 @@ def RunTests(debug, verbosity, processes, test_preserve_dirs, args, toolpath):
 
     # Run the entry tests first ,since these need to be the first to import the
     # 'entry' module.
-    test_util.RunTestSuites(
+    test_util.run_test_suites(
         result, debug, verbosity, test_preserve_dirs, processes, test_name,
         toolpath,
         [bintool_test.TestBintool, entry_test.TestEntry, ftest.TestFunctional,
          fdt_test.TestFdt, elf_test.TestElf, image_test.TestImage,
          cbfs_util_test.TestCbfs, fip_util_test.TestFip])
 
-    return test_util.ReportResult('binman', test_name, result)
+    return test_util.report_result('binman', test_name, result)
 
 def RunTestCoverage(toolpath):
     """Run the tests and check that we get 100% coverage"""
@@ -102,7 +102,7 @@ def RunTestCoverage(toolpath):
     if toolpath:
         for path in toolpath:
             extra_args += ' --toolpath %s' % path
-    test_util.RunTestCoverage('tools/binman/binman', None,
+    test_util.run_test_coverage('tools/binman/binman', None,
             ['*test*', '*main.py', 'tools/patman/*', 'tools/dtoc/*'],
             args.build_dir, all_set, extra_args or None)
 
diff --git a/tools/dtoc/main.py b/tools/dtoc/main.py
index 6f9b526bd74..0a5bd4b88e6 100755
--- a/tools/dtoc/main.py
+++ b/tools/dtoc/main.py
@@ -55,17 +55,17 @@ def run_tests(processes, args):
 
     test_dtoc.setup()
 
-    test_util.RunTestSuites(
+    test_util.run_test_suites(
         result, debug=True, verbosity=1, test_preserve_dirs=False,
         processes=processes, test_name=test_name, toolpath=[],
         test_class_list=[test_dtoc.TestDtoc,test_src_scan.TestSrcScan])
 
-    return test_util.ReportResult('binman', test_name, result)
+    return test_util.report_result('binman', test_name, result)
 
 def RunTestCoverage():
     """Run the tests and check that we get 100% coverage"""
     sys.argv = [sys.argv[0]]
-    test_util.RunTestCoverage('tools/dtoc/dtoc', '/main.py',
+    test_util.run_test_coverage('tools/dtoc/dtoc', '/main.py',
             ['tools/patman/*.py', '*/fdt*', '*test*'], args.build_dir)
 
 
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index 5a4e9e08145..c789822afae 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -715,7 +715,7 @@ class TestFdtUtil(unittest.TestCase):
 
 def RunTestCoverage():
     """Run the tests and check that we get 100% coverage"""
-    test_util.RunTestCoverage('tools/dtoc/test_fdt.py', None,
+    test_util.run_test_coverage('tools/dtoc/test_fdt.py', None,
             ['tools/patman/*.py', '*test_fdt.py'], options.build_dir)
 
 
diff --git a/tools/patman/main.py b/tools/patman/main.py
index c75e8c4f51d..11cf72835a9 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -152,7 +152,7 @@ if args.cmd == 'test':
         suite = doctest.DocTestSuite(module)
         suite.run(result)
 
-    sys.exit(test_util.ReportResult('patman', args.testname, result))
+    sys.exit(test_util.report_result('patman', args.testname, result))
 
 # Process commits, produce patches files, check them, email them
 elif args.cmd == 'send':
diff --git a/tools/patman/test_util.py b/tools/patman/test_util.py
index 5d51a7743a0..bbb210ac9a4 100644
--- a/tools/patman/test_util.py
+++ b/tools/patman/test_util.py
@@ -22,7 +22,7 @@ except:
     use_concurrent = False
 
 
-def RunTestCoverage(prog, filter_fname, exclude_list, build_dir, required=None,
+def run_test_coverage(prog, filter_fname, exclude_list, build_dir, required=None,
                     extra_args=None):
     """Run tests and check that we get 100% coverage
 
@@ -101,7 +101,7 @@ def capture_sys_output():
         sys.stdout, sys.stderr = old_out, old_err
 
 
-def ReportResult(toolname:str, test_name: str, result: unittest.TestResult):
+def report_result(toolname:str, test_name: str, result: unittest.TestResult):
     """Report the results from a suite of tests
 
     Args:
@@ -138,7 +138,7 @@ def ReportResult(toolname:str, test_name: str, result: unittest.TestResult):
     return 0
 
 
-def RunTestSuites(result, debug, verbosity, test_preserve_dirs, processes,
+def run_test_suites(result, debug, verbosity, test_preserve_dirs, processes,
                   test_name, toolpath, test_class_list):
     """Run a series of test suites and collect the results
 
-- 
2.35.0.rc2.247.g8bbb082509-goog



More information about the U-Boot mailing list