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:
@@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user