resulttool: Add option to dump all ptest logs

Adds an option to dump all the ptest logs to individual files in a
specified directory. If multiple test runs are present, the
'--prepend-run' argument will create separate directories for each test
run under the target directory and put the logs there to prevent each
test run from clobbering the others.

[YOCTO #13331]

(From OE-Core rev: bb5a0fedda2817b9d71186a90a1f77bff3cbecaf)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Watt
2019-05-08 11:16:23 -05:00
committed by Richard Purdie
parent 4c5f3371ed
commit 215f6dcd0a
2 changed files with 52 additions and 14 deletions

View File

@@ -167,3 +167,19 @@ def git_get_result(repo, tags):
append_resultsdata(results, obj)
return results
def test_run_results(results):
"""
Convenient generator function that iterates over all test runs that have a
result section.
Generates a tuple of:
(result json file path, test run name, test run (dict), test run "results" (dict))
for each test run that has a "result" section
"""
for path in results:
for run_name, test_run in results[path].items():
if not 'result' in test_run:
continue
yield path, run_name, test_run, test_run['result']