mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
resulttool: add LTP compliance section
(From OE-Core rev: 0188ada3f40f21637b8cde00dd7c634416e01ddb) Signed-off-by: Armin Kuster <akuster808@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:
committed by
Richard Purdie
parent
937b52a310
commit
5523c5a7e5
@@ -18,6 +18,7 @@ class ResultsTextReport(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ptests = {}
|
self.ptests = {}
|
||||||
self.ltptests = {}
|
self.ltptests = {}
|
||||||
|
self.ltpposixtests = {}
|
||||||
self.result_types = {'passed': ['PASSED', 'passed'],
|
self.result_types = {'passed': ['PASSED', 'passed'],
|
||||||
'failed': ['FAILED', 'failed', 'ERROR', 'error', 'UNKNOWN'],
|
'failed': ['FAILED', 'failed', 'ERROR', 'error', 'UNKNOWN'],
|
||||||
'skipped': ['SKIPPED', 'skipped']}
|
'skipped': ['SKIPPED', 'skipped']}
|
||||||
@@ -82,6 +83,37 @@ class ResultsTextReport(object):
|
|||||||
if status in self.result_types[tk]:
|
if status in self.result_types[tk]:
|
||||||
self.ltptests[suite][tk] += 1
|
self.ltptests[suite][tk] += 1
|
||||||
|
|
||||||
|
def handle_ltpposixtest_result(self, k, status, result):
|
||||||
|
if k == 'ltpposixresult.sections':
|
||||||
|
# Ensure tests without any test results still show up on the report
|
||||||
|
for suite in result['ltpposixresult.sections']:
|
||||||
|
if suite not in self.ltpposixtests:
|
||||||
|
self.ltpposixtests[suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []}
|
||||||
|
if 'duration' in result['ltpposixresult.sections'][suite]:
|
||||||
|
self.ltpposixtests[suite]['duration'] = result['ltpposixresult.sections'][suite]['duration']
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
_, suite, test = k.split(".", 2)
|
||||||
|
except ValueError:
|
||||||
|
return
|
||||||
|
# Handle 'glib-2.0'
|
||||||
|
if 'ltpposixresult.sections' in result and suite not in result['ltpposixresult.sections']:
|
||||||
|
try:
|
||||||
|
_, suite, suite1, test = k.split(".", 3)
|
||||||
|
if suite + "." + suite1 in result['ltpposixresult.sections']:
|
||||||
|
suite = suite + "." + suite1
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
if suite not in self.ltpposixtests:
|
||||||
|
self.ltpposixtests[suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []}
|
||||||
|
for tk in self.result_types:
|
||||||
|
if status in self.result_types[tk]:
|
||||||
|
self.ltpposixtests[suite][tk] += 1
|
||||||
|
|
||||||
|
def get_aggregated_test_result(self, logger, testresult):
|
||||||
|
test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []}
|
||||||
|
def get_aggregated_test_result(self, logger, testresult):
|
||||||
|
test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []}
|
||||||
def get_aggregated_test_result(self, logger, testresult):
|
def get_aggregated_test_result(self, logger, testresult):
|
||||||
test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []}
|
test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []}
|
||||||
def get_aggregated_test_result(self, logger, testresult):
|
def get_aggregated_test_result(self, logger, testresult):
|
||||||
@@ -98,6 +130,8 @@ class ResultsTextReport(object):
|
|||||||
self.handle_ptest_result(k, test_status, result)
|
self.handle_ptest_result(k, test_status, result)
|
||||||
if k.startswith("ltpresult."):
|
if k.startswith("ltpresult."):
|
||||||
self.handle_ltptest_result(k, test_status, result)
|
self.handle_ltptest_result(k, test_status, result)
|
||||||
|
if k.startswith("ltpposixresult."):
|
||||||
|
self.handle_ltpposixtest_result(k, test_status, result)
|
||||||
return test_count_report
|
return test_count_report
|
||||||
|
|
||||||
def print_test_report(self, template_file_name, test_count_reports):
|
def print_test_report(self, template_file_name, test_count_reports):
|
||||||
@@ -109,9 +143,10 @@ class ResultsTextReport(object):
|
|||||||
havefailed = False
|
havefailed = False
|
||||||
haveptest = bool(self.ptests)
|
haveptest = bool(self.ptests)
|
||||||
haveltp = bool(self.ltptests)
|
haveltp = bool(self.ltptests)
|
||||||
|
haveltpposix = bool(self.ltpposixtests)
|
||||||
reportvalues = []
|
reportvalues = []
|
||||||
cols = ['passed', 'failed', 'skipped']
|
cols = ['passed', 'failed', 'skipped']
|
||||||
maxlen = {'passed' : 0, 'failed' : 0, 'skipped' : 0, 'result_id': 0, 'testseries' : 0, 'ptest' : 0 ,'ltptest': 0}
|
maxlen = {'passed' : 0, 'failed' : 0, 'skipped' : 0, 'result_id': 0, 'testseries' : 0, 'ptest' : 0 ,'ltptest': 0, 'ltpposixtest': 0}
|
||||||
for line in test_count_reports:
|
for line in test_count_reports:
|
||||||
total_tested = line['passed'] + line['failed'] + line['skipped']
|
total_tested = line['passed'] + line['failed'] + line['skipped']
|
||||||
vals = {}
|
vals = {}
|
||||||
@@ -133,12 +168,17 @@ class ResultsTextReport(object):
|
|||||||
for ltptest in self.ltptests:
|
for ltptest in self.ltptests:
|
||||||
if len(ltptest) > maxlen['ltptest']:
|
if len(ltptest) > maxlen['ltptest']:
|
||||||
maxlen['ltptest'] = len(ltptest)
|
maxlen['ltptest'] = len(ltptest)
|
||||||
|
for ltpposixtest in self.ltpposixtests:
|
||||||
|
if len(ltpposixtest) > maxlen['ltpposixtest']:
|
||||||
|
maxlen['ltpposixtest'] = len(ltpposixtest)
|
||||||
output = template.render(reportvalues=reportvalues,
|
output = template.render(reportvalues=reportvalues,
|
||||||
havefailed=havefailed,
|
havefailed=havefailed,
|
||||||
haveptest=haveptest,
|
haveptest=haveptest,
|
||||||
ptests=self.ptests,
|
ptests=self.ptests,
|
||||||
haveltp=haveltp,
|
haveltp=haveltp,
|
||||||
|
haveltpposix=haveltpposix,
|
||||||
ltptests=self.ltptests,
|
ltptests=self.ltptests,
|
||||||
|
ltpposixtests=self.ltpposixtests,
|
||||||
maxlen=maxlen)
|
maxlen=maxlen)
|
||||||
print(output)
|
print(output)
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,23 @@ Ltp Test Result Summary
|
|||||||
There was no LTP Test data
|
There was no LTP Test data
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if haveltpposix %}
|
||||||
|
==============================================================================================================
|
||||||
|
Ltp Posix Result Summary
|
||||||
|
==============================================================================================================
|
||||||
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
{{ 'Recipe'.ljust(maxlen['ltpposixtest']) }} | {{ 'Passed'.ljust(maxlen['passed']) }} | {{ 'Failed'.ljust(maxlen['failed']) }} | {{ 'Skipped'.ljust(maxlen['skipped']) }} | {{ 'Time(s)'.ljust(10) }}
|
||||||
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
{% for ltpposixtest in ltpposixtests |sort %}
|
||||||
|
{{ ltpposixtest.ljust(maxlen['ltpposixtest']) }} | {{ (ltpposixtests[ltpposixtest]['passed']|string).ljust(maxlen['passed']) }} | {{ (ltpposixtests[ltpposixtest]['failed']|string).ljust(maxlen['failed']) }} | {{ (ltpposixtests[ltpposixtest]['skipped']|string).ljust(maxlen['skipped']) }} | {{ (ltpposixtests[ltpposixtest]['duration']|string) }}
|
||||||
|
{% endfor %}
|
||||||
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
There was no LTP Posix Test data
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================================================
|
==============================================================================================================
|
||||||
Failed test cases (sorted by testseries, ID)
|
Failed test cases (sorted by testseries, ID)
|
||||||
|
|||||||
Reference in New Issue
Block a user