summaryrefslogtreecommitdiff
path: root/scripts/lib/resulttool/resultutils.py
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-05-08 11:16:23 -0500
committerArmin Kuster <akuster808@gmail.com>2019-05-17 21:55:31 -0700
commit7d0dfd6ada9b2fdf0c14833c388730ffc887af49 (patch)
tree454ed4cfb543320bf6269720b16d324763828f46 /scripts/lib/resulttool/resultutils.py
parent8f6d55056a1c6f9fd00b09a8e91b3e888750e793 (diff)
downloadopenembedded-core-7d0dfd6ada9b2fdf0c14833c388730ffc887af49.tar.gz
openembedded-core-7d0dfd6ada9b2fdf0c14833c388730ffc887af49.tar.bz2
openembedded-core-7d0dfd6ada9b2fdf0c14833c388730ffc887af49.zip
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] 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>
Diffstat (limited to 'scripts/lib/resulttool/resultutils.py')
-rw-r--r--scripts/lib/resulttool/resultutils.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/lib/resulttool/resultutils.py b/scripts/lib/resulttool/resultutils.py
index 8d17c7cd65..07dab4cbd3 100644
--- a/scripts/lib/resulttool/resultutils.py
+++ b/scripts/lib/resulttool/resultutils.py
@@ -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']
+