summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>2019-11-07 17:50:29 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-14 13:20:59 +0000
commit610b02a2fbdf66488edb91963c08daf6f928a7f7 (patch)
tree5b24ff58311be14931a49681115bef9b81b6fc88
parent565b05b0e477610468f24b2914f576b66309ab7d (diff)
downloadpoky-610b02a2fbdf66488edb91963c08daf6f928a7f7.tar.gz
scripts/resulttool/report: Add total statistic to test result.
Add total passed, failed, and skipped statistic to test result. (From OE-Core rev: 7ad74f99b6105f23bcf930712627aac279c6af10) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/resulttool/report.py5
-rw-r--r--scripts/lib/resulttool/template/test_report_full_text.txt3
2 files changed, 7 insertions, 1 deletions
diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index 0c83fb6a74..692dd7a851 100644
--- a/scripts/lib/resulttool/report.py
+++ b/scripts/lib/resulttool/report.py
@@ -186,6 +186,10 @@ class ResultsTextReport(object):
186 havefailed = True 186 havefailed = True
187 if line['machine'] not in machines: 187 if line['machine'] not in machines:
188 machines.append(line['machine']) 188 machines.append(line['machine'])
189 reporttotalvalues = {}
190 for k in cols:
191 reporttotalvalues[k] = '%s' % sum([line[k] for line in test_count_reports])
192 reporttotalvalues['count'] = '%s' % len(test_count_reports)
189 for (machine, report) in self.ptests.items(): 193 for (machine, report) in self.ptests.items():
190 for ptest in self.ptests[machine]: 194 for ptest in self.ptests[machine]:
191 if len(ptest) > maxlen['ptest']: 195 if len(ptest) > maxlen['ptest']:
@@ -199,6 +203,7 @@ class ResultsTextReport(object):
199 if len(ltpposixtest) > maxlen['ltpposixtest']: 203 if len(ltpposixtest) > maxlen['ltpposixtest']:
200 maxlen['ltpposixtest'] = len(ltpposixtest) 204 maxlen['ltpposixtest'] = len(ltpposixtest)
201 output = template.render(reportvalues=reportvalues, 205 output = template.render(reportvalues=reportvalues,
206 reporttotalvalues=reporttotalvalues,
202 havefailed=havefailed, 207 havefailed=havefailed,
203 machines=machines, 208 machines=machines,
204 ptests=self.ptests, 209 ptests=self.ptests,
diff --git a/scripts/lib/resulttool/template/test_report_full_text.txt b/scripts/lib/resulttool/template/test_report_full_text.txt
index 17c99cb4e7..2efba2ef6f 100644
--- a/scripts/lib/resulttool/template/test_report_full_text.txt
+++ b/scripts/lib/resulttool/template/test_report_full_text.txt
@@ -8,7 +8,8 @@ Test Result Status Summary (Counts/Percentages sorted by testseries, ID)
8{{ report.testseries.ljust(maxlen['testseries']) }} | {{ report.result_id.ljust(maxlen['result_id']) }} | {{ (report.passed|string).ljust(maxlen['passed']) }} | {{ (report.failed|string).ljust(maxlen['failed']) }} | {{ (report.skipped|string).ljust(maxlen['skipped']) }} 8{{ report.testseries.ljust(maxlen['testseries']) }} | {{ report.result_id.ljust(maxlen['result_id']) }} | {{ (report.passed|string).ljust(maxlen['passed']) }} | {{ (report.failed|string).ljust(maxlen['failed']) }} | {{ (report.skipped|string).ljust(maxlen['skipped']) }}
9{% endfor %} 9{% endfor %}
10-------------------------------------------------------------------------------------------------------------- 10--------------------------------------------------------------------------------------------------------------
11 11{{ 'Total'.ljust(maxlen['testseries']) }} | {{ reporttotalvalues['count'].ljust(maxlen['result_id']) }} | {{ reporttotalvalues['passed'].ljust(maxlen['passed']) }} | {{ reporttotalvalues['failed'].ljust(maxlen['failed']) }} | {{ reporttotalvalues['skipped'].ljust(maxlen['skipped']) }}
12--------------------------------------------------------------------------------------------------------------
12 13
13{% for machine in machines %} 14{% for machine in machines %}
14{% if ptests[machine] %} 15{% if ptests[machine] %}