1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-01 23:41:18 +02:00

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>
This commit is contained in:
Simon Glass
2022-01-22 05:07:28 -07:00
committed by Tom Rini
parent ce3e75dc59
commit 1d0f30e936
3 changed files with 16 additions and 23 deletions

View File

@@ -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))