patman: test_util: Use unittest text runner to print test results
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Sat, 2 Apr 2022 17:06:06 +0000 (20:06 +0300)
committerSimon Glass <sjg@chromium.org>
Tue, 28 Jun 2022 02:09:51 +0000 (03:09 +0100)
commitd8318feba1ef3b2a74495ea7dca33ad1276a4ffe
treeb9bcd3f8e6cd91a6f7c1ab3ea84047a4cfe1ebf1
parentce12c47b92152e9457d3daa3ddbf53c1cc3de0bb
patman: test_util: Use unittest text runner to print test results

The python tools' test utilities handle printing test results, but the
output is quite bare compared to an ordinary unittest run. Delegate
printing the results to a unittest text runner, which gives us niceties
like clear separation between each test's result and how long it took to
run the test suite.

Unfortunately it does not print info for skipped tests by default, but
this can be handled later by a custom test result subclass. It also does
not print the tool name; manually print a heading that includes the
toolname so that the outputs of each tool's tests are distinguishable in
the CI output.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/binman/main.py
tools/buildman/main.py
tools/dtoc/main.py
tools/dtoc/test_fdt.py
tools/patman/main.py
tools/patman/test_util.py