summaryrefslogtreecommitdiff
path: root/tools/patman/main.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-01-22 05:07:28 -0700
committerTom Rini <trini@konsulko.com>2022-02-08 23:07:59 -0500
commit1d0f30e936d2fabbbaa34c3904369252d54a56cc (patch)
treee8436bb0186b0acff50dc4d77879509e65dbc950 /tools/patman/main.py
parentce3e75dc5977e6500669fd9418405ddd4207a164 (diff)
patman: Update test_util to run doc tests
At present this function does not run the doctests. Allow the caller to pass these modules in as strings. Update patman to use this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/main.py')
-rwxr-xr-xtools/patman/main.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/tools/patman/main.py b/tools/patman/main.py
index e5be28e3316..c01ae36e9f9 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -134,23 +134,11 @@ if args.cmd == 'test':
import doctest
from patman import func_test
- sys.argv = [sys.argv[0]]
result = unittest.TestResult()
- suite = unittest.TestSuite()
- loader = unittest.TestLoader()
- for module in (test_checkpatch.TestPatch, func_test.TestFunctional):
- if args.testname:
- try:
- suite.addTests(loader.loadTestsFromName(args.testname, module))
- except AttributeError:
- continue
- else:
- suite.addTests(loader.loadTestsFromTestCase(module))
- suite.run(result)
-
- for module in ['gitutil', 'settings', 'terminal']:
- suite = doctest.DocTestSuite(module)
- suite.run(result)
+ test_util.RunTestSuites(
+ result, False, False, False, None, None, None,
+ [test_checkpatch.TestPatch, func_test.TestFunctional,
+ 'gitutil', 'settings', 'terminal'])
sys.exit(test_util.ReportResult('patman', args.testname, result))