summaryrefslogtreecommitdiffstats
path: root/scripts/lib/resulttool/resultutils.py
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-05-08 11:16:23 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-20 14:38:16 +0100
commit215f6dcd0ae35e8f700bae1bdc68d25e2e642d03 (patch)
tree7c00544e052b6a7b7a7181ee0d7b1b48f47204be /scripts/lib/resulttool/resultutils.py
parent4c5f3371ede0b5a8c472e142c4add94268a74f51 (diff)
downloadpoky-215f6dcd0ae35e8f700bae1bdc68d25e2e642d03.tar.gz
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>
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):
167 append_resultsdata(results, obj) 167 append_resultsdata(results, obj)
168 168
169 return results 169 return results
170
171def test_run_results(results):
172 """
173 Convenient generator function that iterates over all test runs that have a
174 result section.
175
176 Generates a tuple of:
177 (result json file path, test run name, test run (dict), test run "results" (dict))
178 for each test run that has a "result" section
179 """
180 for path in results:
181 for run_name, test_run in results[path].items():
182 if not 'result' in test_run:
183 continue
184 yield path, run_name, test_run, test_run['result']
185