summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-04-22 06:32:41 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-18 11:28:58 +0100
commit5523c5a7e56e2b0e9ec869d3a8cf8eb2e83781bf (patch)
tree7414d12a0926fd13e42d44736484ae2dd42343af /scripts
parent937b52a3107e4acae2f37b3c3401077ab496985c (diff)
downloadpoky-5523c5a7e56e2b0e9ec869d3a8cf8eb2e83781bf.tar.gz
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/resulttool/report.py42
-rw-r--r--scripts/lib/resulttool/template/test_report_full_text.txt17
2 files changed, 58 insertions, 1 deletions
diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index a98f2393e6..cb6b1cf948 100644
--- a/scripts/lib/resulttool/report.py
+++ b/scripts/lib/resulttool/report.py
@@ -18,6 +18,7 @@ class ResultsTextReport(object):
18 def __init__(self): 18 def __init__(self):
19 self.ptests = {} 19 self.ptests = {}
20 self.ltptests = {} 20 self.ltptests = {}
21 self.ltpposixtests = {}
21 self.result_types = {'passed': ['PASSED', 'passed'], 22 self.result_types = {'passed': ['PASSED', 'passed'],
22 'failed': ['FAILED', 'failed', 'ERROR', 'error', 'UNKNOWN'], 23 'failed': ['FAILED', 'failed', 'ERROR', 'error', 'UNKNOWN'],
23 'skipped': ['SKIPPED', 'skipped']} 24 'skipped': ['SKIPPED', 'skipped']}
@@ -82,6 +83,37 @@ class ResultsTextReport(object):
82 if status in self.result_types[tk]: 83 if status in self.result_types[tk]:
83 self.ltptests[suite][tk] += 1 84 self.ltptests[suite][tk] += 1
84 85
86 def handle_ltpposixtest_result(self, k, status, result):
87 if k == 'ltpposixresult.sections':
88 # Ensure tests without any test results still show up on the report
89 for suite in result['ltpposixresult.sections']:
90 if suite not in self.ltpposixtests:
91 self.ltpposixtests[suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []}
92 if 'duration' in result['ltpposixresult.sections'][suite]:
93 self.ltpposixtests[suite]['duration'] = result['ltpposixresult.sections'][suite]['duration']
94 return
95 try:
96 _, suite, test = k.split(".", 2)
97 except ValueError:
98 return
99 # Handle 'glib-2.0'
100 if 'ltpposixresult.sections' in result and suite not in result['ltpposixresult.sections']:
101 try:
102 _, suite, suite1, test = k.split(".", 3)
103 if suite + "." + suite1 in result['ltpposixresult.sections']:
104 suite = suite + "." + suite1
105 except ValueError:
106 pass
107 if suite not in self.ltpposixtests:
108 self.ltpposixtests[suite] = {'passed': 0, 'failed': 0, 'skipped': 0, 'duration' : '-', 'failed_testcases': []}
109 for tk in self.result_types:
110 if status in self.result_types[tk]:
111 self.ltpposixtests[suite][tk] += 1
112
113 def get_aggregated_test_result(self, logger, testresult):
114 test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []}
115 def get_aggregated_test_result(self, logger, testresult):
116 test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []}
85 def get_aggregated_test_result(self, logger, testresult): 117 def get_aggregated_test_result(self, logger, testresult):
86 test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []} 118 test_count_report = {'passed': 0, 'failed': 0, 'skipped': 0, 'failed_testcases': []}
87 def get_aggregated_test_result(self, logger, testresult): 119 def get_aggregated_test_result(self, logger, testresult):
@@ -98,6 +130,8 @@ class ResultsTextReport(object):
98 self.handle_ptest_result(k, test_status, result) 130 self.handle_ptest_result(k, test_status, result)
99 if k.startswith("ltpresult."): 131 if k.startswith("ltpresult."):
100 self.handle_ltptest_result(k, test_status, result) 132 self.handle_ltptest_result(k, test_status, result)
133 if k.startswith("ltpposixresult."):
134 self.handle_ltpposixtest_result(k, test_status, result)
101 return test_count_report 135 return test_count_report
102 136
103 def print_test_report(self, template_file_name, test_count_reports): 137 def print_test_report(self, template_file_name, test_count_reports):
@@ -109,9 +143,10 @@ class ResultsTextReport(object):
109 havefailed = False 143 havefailed = False
110 haveptest = bool(self.ptests) 144 haveptest = bool(self.ptests)
111 haveltp = bool(self.ltptests) 145 haveltp = bool(self.ltptests)
146 haveltpposix = bool(self.ltpposixtests)
112 reportvalues = [] 147 reportvalues = []
113 cols = ['passed', 'failed', 'skipped'] 148 cols = ['passed', 'failed', 'skipped']
114 maxlen = {'passed' : 0, 'failed' : 0, 'skipped' : 0, 'result_id': 0, 'testseries' : 0, 'ptest' : 0 ,'ltptest': 0} 149 maxlen = {'passed' : 0, 'failed' : 0, 'skipped' : 0, 'result_id': 0, 'testseries' : 0, 'ptest' : 0 ,'ltptest': 0, 'ltpposixtest': 0}
115 for line in test_count_reports: 150 for line in test_count_reports:
116 total_tested = line['passed'] + line['failed'] + line['skipped'] 151 total_tested = line['passed'] + line['failed'] + line['skipped']
117 vals = {} 152 vals = {}
@@ -133,12 +168,17 @@ class ResultsTextReport(object):
133 for ltptest in self.ltptests: 168 for ltptest in self.ltptests:
134 if len(ltptest) > maxlen['ltptest']: 169 if len(ltptest) > maxlen['ltptest']:
135 maxlen['ltptest'] = len(ltptest) 170 maxlen['ltptest'] = len(ltptest)
171 for ltpposixtest in self.ltpposixtests:
172 if len(ltpposixtest) > maxlen['ltpposixtest']:
173 maxlen['ltpposixtest'] = len(ltpposixtest)
136 output = template.render(reportvalues=reportvalues, 174 output = template.render(reportvalues=reportvalues,
137 havefailed=havefailed, 175 havefailed=havefailed,
138 haveptest=haveptest, 176 haveptest=haveptest,
139 ptests=self.ptests, 177 ptests=self.ptests,
140 haveltp=haveltp, 178 haveltp=haveltp,
179 haveltpposix=haveltpposix,
141 ltptests=self.ltptests, 180 ltptests=self.ltptests,
181 ltpposixtests=self.ltpposixtests,
142 maxlen=maxlen) 182 maxlen=maxlen)
143 print(output) 183 print(output)
144 184
diff --git a/scripts/lib/resulttool/template/test_report_full_text.txt b/scripts/lib/resulttool/template/test_report_full_text.txt
index 6ecd5bce59..d2725b8d01 100644
--- a/scripts/lib/resulttool/template/test_report_full_text.txt
+++ b/scripts/lib/resulttool/template/test_report_full_text.txt
@@ -41,6 +41,23 @@ Ltp Test Result Summary
41There was no LTP Test data 41There was no LTP Test data
42{% endif %} 42{% endif %}
43 43
44{% if haveltpposix %}
45==============================================================================================================
46Ltp Posix Result Summary
47==============================================================================================================
48--------------------------------------------------------------------------------------------------------------
49{{ 'Recipe'.ljust(maxlen['ltpposixtest']) }} | {{ 'Passed'.ljust(maxlen['passed']) }} | {{ 'Failed'.ljust(maxlen['failed']) }} | {{ 'Skipped'.ljust(maxlen['skipped']) }} | {{ 'Time(s)'.ljust(10) }}
50--------------------------------------------------------------------------------------------------------------
51{% for ltpposixtest in ltpposixtests |sort %}
52{{ 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) }}
53{% endfor %}
54--------------------------------------------------------------------------------------------------------------
55
56{% else %}
57There was no LTP Posix Test data
58{% endif %}
59
60
44 61
45============================================================================================================== 62==============================================================================================================
46Failed test cases (sorted by testseries, ID) 63Failed test cases (sorted by testseries, ID)