Clone of official tools

Committer:
screamer
Date:
Thu Jul 14 20:21:19 2016 +0100
Revision:
13:ab47a20b66f0
Parent:
0:66f3b5499f7f
Child:
22:9e85236d8716
Apply latest tools

Who changed what in which revision?

UserRevisionLine numberNew contents of line
screamer 0:66f3b5499f7f 1 """
screamer 0:66f3b5499f7f 2 mbed SDK
screamer 0:66f3b5499f7f 3 Copyright (c) 2011-2014 ARM Limited
screamer 0:66f3b5499f7f 4
screamer 0:66f3b5499f7f 5 Licensed under the Apache License, Version 2.0 (the "License");
screamer 0:66f3b5499f7f 6 you may not use this file except in compliance with the License.
screamer 0:66f3b5499f7f 7 You may obtain a copy of the License at
screamer 0:66f3b5499f7f 8
screamer 0:66f3b5499f7f 9 http://www.apache.org/licenses/LICENSE-2.0
screamer 0:66f3b5499f7f 10
screamer 0:66f3b5499f7f 11 Unless required by applicable law or agreed to in writing, software
screamer 0:66f3b5499f7f 12 distributed under the License is distributed on an "AS IS" BASIS,
screamer 0:66f3b5499f7f 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
screamer 0:66f3b5499f7f 14 See the License for the specific language governing permissions and
screamer 0:66f3b5499f7f 15 limitations under the License.
screamer 0:66f3b5499f7f 16
screamer 0:66f3b5499f7f 17 Author: Przemyslaw Wirkus <Przemyslaw.wirkus@arm.com>
screamer 0:66f3b5499f7f 18 """
screamer 0:66f3b5499f7f 19
screamer 13:ab47a20b66f0 20 from tools.utils import construct_enum, mkdir
screamer 13:ab47a20b66f0 21 import os
screamer 0:66f3b5499f7f 22
screamer 0:66f3b5499f7f 23 ResultExporterType = construct_enum(HTML='Html_Exporter',
screamer 0:66f3b5499f7f 24 JUNIT='JUnit_Exporter',
screamer 0:66f3b5499f7f 25 JUNIT_OPER='JUnit_Exporter_Interoperability',
screamer 0:66f3b5499f7f 26 BUILD='Build_Exporter',
screamer 0:66f3b5499f7f 27 PRINT='Print_Exporter')
screamer 0:66f3b5499f7f 28
screamer 0:66f3b5499f7f 29
screamer 0:66f3b5499f7f 30 class ReportExporter():
screamer 0:66f3b5499f7f 31 """ Class exports extended test result Python data structure to
screamer 0:66f3b5499f7f 32 different formats like HTML, JUnit XML.
screamer 0:66f3b5499f7f 33
screamer 0:66f3b5499f7f 34 Parameter 'test_result_ext' format:
screamer 0:66f3b5499f7f 35
screamer 0:66f3b5499f7f 36 u'uARM': { u'LPC1768': { 'MBED_2': { 0: { 'copy_method': 'shutils.copy()',
screamer 0:66f3b5499f7f 37 'duration': 20,
screamer 0:66f3b5499f7f 38 'elapsed_time': 1.7929999828338623,
screamer 0:66f3b5499f7f 39 'output': 'Host test instrumentation on ...\r\n',
screamer 0:66f3b5499f7f 40 'result': 'OK',
screamer 0:66f3b5499f7f 41 'target_name': u'LPC1768',
screamer 0:66f3b5499f7f 42 'description': 'stdio',
screamer 0:66f3b5499f7f 43 'id': u'MBED_2',
screamer 0:66f3b5499f7f 44 'toolchain_name': u'uARM'}},
screamer 0:66f3b5499f7f 45 """
screamer 0:66f3b5499f7f 46 CSS_STYLE = """<style>
screamer 0:66f3b5499f7f 47 .name{
screamer 0:66f3b5499f7f 48 border: 1px solid;
screamer 0:66f3b5499f7f 49 border-radius: 25px;
screamer 0:66f3b5499f7f 50 width: 100px;
screamer 0:66f3b5499f7f 51 }
screamer 0:66f3b5499f7f 52 .tooltip{
screamer 0:66f3b5499f7f 53 position:absolute;
screamer 0:66f3b5499f7f 54 background-color: #F5DA81;
screamer 0:66f3b5499f7f 55 display:none;
screamer 0:66f3b5499f7f 56 }
screamer 0:66f3b5499f7f 57 </style>
screamer 0:66f3b5499f7f 58 """
screamer 0:66f3b5499f7f 59
screamer 0:66f3b5499f7f 60 JAVASCRIPT = """
screamer 0:66f3b5499f7f 61 <script type="text/javascript">
screamer 0:66f3b5499f7f 62 function show (elem) {
screamer 0:66f3b5499f7f 63 elem.style.display = "block";
screamer 0:66f3b5499f7f 64 }
screamer 0:66f3b5499f7f 65 function hide (elem) {
screamer 0:66f3b5499f7f 66 elem.style.display = "";
screamer 0:66f3b5499f7f 67 }
screamer 0:66f3b5499f7f 68 </script>
screamer 0:66f3b5499f7f 69 """
screamer 0:66f3b5499f7f 70
screamer 0:66f3b5499f7f 71 def __init__(self, result_exporter_type, package="test"):
screamer 0:66f3b5499f7f 72 self.result_exporter_type = result_exporter_type
screamer 0:66f3b5499f7f 73 self.package = package
screamer 0:66f3b5499f7f 74
screamer 13:ab47a20b66f0 75 def report(self, test_summary_ext, test_suite_properties=None,
screamer 13:ab47a20b66f0 76 print_log_for_failures=True):
screamer 0:66f3b5499f7f 77 """ Invokes report depending on exporter_type set in constructor
screamer 0:66f3b5499f7f 78 """
screamer 0:66f3b5499f7f 79 if self.result_exporter_type == ResultExporterType.HTML:
screamer 0:66f3b5499f7f 80 # HTML exporter
screamer 0:66f3b5499f7f 81 return self.exporter_html(test_summary_ext, test_suite_properties)
screamer 0:66f3b5499f7f 82 elif self.result_exporter_type == ResultExporterType.JUNIT:
screamer 0:66f3b5499f7f 83 # JUNIT exporter for results from test suite
screamer 0:66f3b5499f7f 84 return self.exporter_junit(test_summary_ext, test_suite_properties)
screamer 0:66f3b5499f7f 85 elif self.result_exporter_type == ResultExporterType.JUNIT_OPER:
screamer 0:66f3b5499f7f 86 # JUNIT exporter for interoperability test
screamer 0:66f3b5499f7f 87 return self.exporter_junit_ioper(test_summary_ext, test_suite_properties)
screamer 0:66f3b5499f7f 88 elif self.result_exporter_type == ResultExporterType.PRINT:
screamer 0:66f3b5499f7f 89 # JUNIT exporter for interoperability test
screamer 13:ab47a20b66f0 90 return self.exporter_print(test_summary_ext, print_log_for_failures=print_log_for_failures)
screamer 0:66f3b5499f7f 91 return None
screamer 0:66f3b5499f7f 92
screamer 0:66f3b5499f7f 93 def report_to_file(self, test_summary_ext, file_name, test_suite_properties=None):
screamer 0:66f3b5499f7f 94 """ Stores report to specified file
screamer 0:66f3b5499f7f 95 """
screamer 0:66f3b5499f7f 96 report = self.report(test_summary_ext, test_suite_properties=test_suite_properties)
screamer 0:66f3b5499f7f 97 self.write_to_file(report, file_name)
screamer 0:66f3b5499f7f 98
screamer 0:66f3b5499f7f 99 def write_to_file(self, report, file_name):
screamer 0:66f3b5499f7f 100 if report is not None:
screamer 13:ab47a20b66f0 101 dirname = os.path.dirname(file_name)
screamer 13:ab47a20b66f0 102 if dirname:
screamer 13:ab47a20b66f0 103 mkdir(dirname)
screamer 0:66f3b5499f7f 104 with open(file_name, 'w') as f:
screamer 0:66f3b5499f7f 105 f.write(report)
screamer 0:66f3b5499f7f 106
screamer 0:66f3b5499f7f 107 def get_tooltip_name(self, toolchain, target, test_id, loop_no):
screamer 0:66f3b5499f7f 108 """ Generate simple unique tool-tip name which can be used.
screamer 0:66f3b5499f7f 109 For example as HTML <div> section id attribute.
screamer 0:66f3b5499f7f 110 """
screamer 0:66f3b5499f7f 111 return "target_test_%s_%s_%s_%s"% (toolchain.lower(), target.lower(), test_id.lower(), loop_no)
screamer 0:66f3b5499f7f 112
screamer 0:66f3b5499f7f 113 def get_result_div_sections(self, test, test_no):
screamer 0:66f3b5499f7f 114 """ Generates separate <DIV> sections which contains test results output.
screamer 0:66f3b5499f7f 115 """
screamer 0:66f3b5499f7f 116
screamer 0:66f3b5499f7f 117 RESULT_COLORS = {'OK': 'LimeGreen',
screamer 0:66f3b5499f7f 118 'FAIL': 'Orange',
screamer 0:66f3b5499f7f 119 'ERROR': 'LightCoral',
screamer 0:66f3b5499f7f 120 'OTHER': 'LightGray',
screamer 0:66f3b5499f7f 121 }
screamer 0:66f3b5499f7f 122
screamer 0:66f3b5499f7f 123 tooltip_name = self.get_tooltip_name(test['toolchain_name'], test['target_name'], test['id'], test_no)
screamer 0:66f3b5499f7f 124 background_color = RESULT_COLORS[test['result'] if test['result'] in RESULT_COLORS else 'OTHER']
screamer 0:66f3b5499f7f 125 result_div_style = "background-color: %s"% background_color
screamer 0:66f3b5499f7f 126
screamer 0:66f3b5499f7f 127 result = """<div class="name" style="%s" onmouseover="show(%s)" onmouseout="hide(%s)">
screamer 0:66f3b5499f7f 128 <center>%s</center>
screamer 0:66f3b5499f7f 129 <div class = "tooltip" id= "%s">
screamer 0:66f3b5499f7f 130 <b>%s</b><br />
screamer 0:66f3b5499f7f 131 <hr />
screamer 0:66f3b5499f7f 132 <b>%s</b> in <b>%.2f sec</b><br />
screamer 0:66f3b5499f7f 133 <hr />
screamer 0:66f3b5499f7f 134 <small>
screamer 0:66f3b5499f7f 135 %s
screamer 0:66f3b5499f7f 136 </small>
screamer 0:66f3b5499f7f 137 </div>
screamer 0:66f3b5499f7f 138 </div>
screamer 0:66f3b5499f7f 139 """% (result_div_style,
screamer 0:66f3b5499f7f 140 tooltip_name,
screamer 0:66f3b5499f7f 141 tooltip_name,
screamer 0:66f3b5499f7f 142 test['result'],
screamer 0:66f3b5499f7f 143 tooltip_name,
screamer 0:66f3b5499f7f 144 test['target_name_unique'],
screamer 0:66f3b5499f7f 145 test['description'],
screamer 0:66f3b5499f7f 146 test['elapsed_time'],
screamer 0:66f3b5499f7f 147 test['output'].replace('\n', '<br />'))
screamer 0:66f3b5499f7f 148 return result
screamer 0:66f3b5499f7f 149
screamer 0:66f3b5499f7f 150 def get_result_tree(self, test_results):
screamer 0:66f3b5499f7f 151 """ If test was run in a loop (we got few results from the same test)
screamer 0:66f3b5499f7f 152 we will show it in a column to see all results.
screamer 0:66f3b5499f7f 153 This function produces HTML table with corresponding results.
screamer 0:66f3b5499f7f 154 """
screamer 0:66f3b5499f7f 155 result = ''
screamer 0:66f3b5499f7f 156 for i, test_result in enumerate(test_results):
screamer 0:66f3b5499f7f 157 result += '<table>'
screamer 0:66f3b5499f7f 158 test_ids = sorted(test_result.keys())
screamer 0:66f3b5499f7f 159 for test_no in test_ids:
screamer 0:66f3b5499f7f 160 test = test_result[test_no]
screamer 0:66f3b5499f7f 161 result += """<tr>
screamer 0:66f3b5499f7f 162 <td valign="top">%s</td>
screamer 0:66f3b5499f7f 163 </tr>"""% self.get_result_div_sections(test, "%d_%d" % (test_no, i))
screamer 0:66f3b5499f7f 164 result += '</table>'
screamer 0:66f3b5499f7f 165 return result
screamer 0:66f3b5499f7f 166
screamer 0:66f3b5499f7f 167 def get_all_unique_test_ids(self, test_result_ext):
screamer 0:66f3b5499f7f 168 """ Gets all unique test ids from all ran tests.
screamer 0:66f3b5499f7f 169 We need this to create complete list of all test ran.
screamer 0:66f3b5499f7f 170 """
screamer 0:66f3b5499f7f 171 result = []
screamer 0:66f3b5499f7f 172 targets = test_result_ext.keys()
screamer 0:66f3b5499f7f 173 for target in targets:
screamer 0:66f3b5499f7f 174 toolchains = test_result_ext[target].keys()
screamer 0:66f3b5499f7f 175 for toolchain in toolchains:
screamer 0:66f3b5499f7f 176 tests = test_result_ext[target][toolchain].keys()
screamer 0:66f3b5499f7f 177 result.extend(tests)
screamer 0:66f3b5499f7f 178 return sorted(list(set(result)))
screamer 0:66f3b5499f7f 179
screamer 0:66f3b5499f7f 180 #
screamer 0:66f3b5499f7f 181 # Exporters functions
screamer 0:66f3b5499f7f 182 #
screamer 0:66f3b5499f7f 183
screamer 0:66f3b5499f7f 184 def exporter_html(self, test_result_ext, test_suite_properties=None):
screamer 0:66f3b5499f7f 185 """ Export test results in proprietary HTML format.
screamer 0:66f3b5499f7f 186 """
screamer 0:66f3b5499f7f 187 result = """<html>
screamer 0:66f3b5499f7f 188 <head>
screamer 0:66f3b5499f7f 189 <title>mbed SDK test suite test result report</title>
screamer 0:66f3b5499f7f 190 %s
screamer 0:66f3b5499f7f 191 %s
screamer 0:66f3b5499f7f 192 </head>
screamer 0:66f3b5499f7f 193 <body>
screamer 0:66f3b5499f7f 194 """% (self.CSS_STYLE, self.JAVASCRIPT)
screamer 0:66f3b5499f7f 195
screamer 0:66f3b5499f7f 196 unique_test_ids = self.get_all_unique_test_ids(test_result_ext)
screamer 0:66f3b5499f7f 197 targets = sorted(test_result_ext.keys())
screamer 13:ab47a20b66f0 198 result += '<table>'
screamer 0:66f3b5499f7f 199 for target in targets:
screamer 0:66f3b5499f7f 200 toolchains = sorted(test_result_ext[target].keys())
screamer 0:66f3b5499f7f 201 for toolchain in toolchains:
screamer 13:ab47a20b66f0 202 result += '<tr>'
screamer 0:66f3b5499f7f 203 result += '<td></td>'
screamer 0:66f3b5499f7f 204 result += '<td></td>'
screamer 0:66f3b5499f7f 205
screamer 0:66f3b5499f7f 206 tests = sorted(test_result_ext[target][toolchain].keys())
screamer 0:66f3b5499f7f 207 for test in unique_test_ids:
screamer 0:66f3b5499f7f 208 result += """<td align="center">%s</td>"""% test
screamer 0:66f3b5499f7f 209 result += """</tr>
screamer 0:66f3b5499f7f 210 <tr>
screamer 0:66f3b5499f7f 211 <td valign="center">%s</td>
screamer 0:66f3b5499f7f 212 <td valign="center"><b>%s</b></td>
screamer 0:66f3b5499f7f 213 """% (toolchain, target)
screamer 0:66f3b5499f7f 214
screamer 0:66f3b5499f7f 215 for test in unique_test_ids:
screamer 0:66f3b5499f7f 216 test_result = self.get_result_tree(test_result_ext[target][toolchain][test]) if test in tests else ''
screamer 0:66f3b5499f7f 217 result += '<td>%s</td>'% (test_result)
screamer 0:66f3b5499f7f 218
screamer 0:66f3b5499f7f 219 result += '</tr>'
screamer 0:66f3b5499f7f 220 result += '</table>'
screamer 0:66f3b5499f7f 221 result += '</body></html>'
screamer 0:66f3b5499f7f 222 return result
screamer 0:66f3b5499f7f 223
screamer 0:66f3b5499f7f 224 def exporter_junit_ioper(self, test_result_ext, test_suite_properties=None):
screamer 0:66f3b5499f7f 225 from junit_xml import TestSuite, TestCase
screamer 0:66f3b5499f7f 226 test_suites = []
screamer 0:66f3b5499f7f 227 test_cases = []
screamer 0:66f3b5499f7f 228
screamer 0:66f3b5499f7f 229 for platform in sorted(test_result_ext.keys()):
screamer 0:66f3b5499f7f 230 # {platform : ['Platform', 'Result', 'Scope', 'Description'])
screamer 0:66f3b5499f7f 231 test_cases = []
screamer 0:66f3b5499f7f 232 for tr_result in test_result_ext[platform]:
screamer 0:66f3b5499f7f 233 result, name, scope, description = tr_result
screamer 0:66f3b5499f7f 234
screamer 0:66f3b5499f7f 235 classname = 'test.ioper.%s.%s.%s' % (platform, name, scope)
screamer 0:66f3b5499f7f 236 elapsed_sec = 0
screamer 0:66f3b5499f7f 237 _stdout = description
screamer 0:66f3b5499f7f 238 _stderr = ''
screamer 0:66f3b5499f7f 239 # Test case
screamer 0:66f3b5499f7f 240 tc = TestCase(name, classname, elapsed_sec, _stdout, _stderr)
screamer 0:66f3b5499f7f 241 # Test case extra failure / error info
screamer 0:66f3b5499f7f 242 if result == 'FAIL':
screamer 0:66f3b5499f7f 243 tc.add_failure_info(description, _stdout)
screamer 0:66f3b5499f7f 244 elif result == 'ERROR':
screamer 0:66f3b5499f7f 245 tc.add_error_info(description, _stdout)
screamer 0:66f3b5499f7f 246 elif result == 'SKIP' or result == 'NOT_SUPPORTED':
screamer 0:66f3b5499f7f 247 tc.add_skipped_info(description, _stdout)
screamer 0:66f3b5499f7f 248
screamer 0:66f3b5499f7f 249 test_cases.append(tc)
screamer 0:66f3b5499f7f 250 ts = TestSuite("test.suite.ioper.%s" % (platform), test_cases)
screamer 0:66f3b5499f7f 251 test_suites.append(ts)
screamer 0:66f3b5499f7f 252 return TestSuite.to_xml_string(test_suites)
screamer 0:66f3b5499f7f 253
screamer 0:66f3b5499f7f 254 def exporter_junit(self, test_result_ext, test_suite_properties=None):
screamer 0:66f3b5499f7f 255 """ Export test results in JUnit XML compliant format
screamer 0:66f3b5499f7f 256 """
screamer 0:66f3b5499f7f 257 from junit_xml import TestSuite, TestCase
screamer 0:66f3b5499f7f 258 test_suites = []
screamer 0:66f3b5499f7f 259 test_cases = []
screamer 0:66f3b5499f7f 260
screamer 0:66f3b5499f7f 261 targets = sorted(test_result_ext.keys())
screamer 0:66f3b5499f7f 262 for target in targets:
screamer 0:66f3b5499f7f 263 toolchains = sorted(test_result_ext[target].keys())
screamer 0:66f3b5499f7f 264 for toolchain in toolchains:
screamer 0:66f3b5499f7f 265 test_cases = []
screamer 0:66f3b5499f7f 266 tests = sorted(test_result_ext[target][toolchain].keys())
screamer 0:66f3b5499f7f 267 for test in tests:
screamer 0:66f3b5499f7f 268 test_results = test_result_ext[target][toolchain][test]
screamer 0:66f3b5499f7f 269 for test_res in test_results:
screamer 0:66f3b5499f7f 270 test_ids = sorted(test_res.keys())
screamer 0:66f3b5499f7f 271 for test_no in test_ids:
screamer 0:66f3b5499f7f 272 test_result = test_res[test_no]
screamer 0:66f3b5499f7f 273 name = test_result['description']
screamer 0:66f3b5499f7f 274 classname = '%s.%s.%s.%s'% (self.package, target, toolchain, test_result['id'])
screamer 0:66f3b5499f7f 275 elapsed_sec = test_result['elapsed_time']
screamer 0:66f3b5499f7f 276 _stdout = test_result['output']
screamer 0:66f3b5499f7f 277
screamer 0:66f3b5499f7f 278 if 'target_name_unique' in test_result:
screamer 0:66f3b5499f7f 279 _stderr = test_result['target_name_unique']
screamer 0:66f3b5499f7f 280 else:
screamer 0:66f3b5499f7f 281 _stderr = test_result['target_name']
screamer 0:66f3b5499f7f 282
screamer 0:66f3b5499f7f 283 # Test case
screamer 0:66f3b5499f7f 284 tc = TestCase(name, classname, elapsed_sec, _stdout, _stderr)
screamer 0:66f3b5499f7f 285
screamer 0:66f3b5499f7f 286 # Test case extra failure / error info
screamer 0:66f3b5499f7f 287 message = test_result['result']
screamer 0:66f3b5499f7f 288 if test_result['result'] == 'FAIL':
screamer 0:66f3b5499f7f 289 tc.add_failure_info(message, _stdout)
screamer 0:66f3b5499f7f 290 elif test_result['result'] == 'SKIP' or test_result["result"] == 'NOT_SUPPORTED':
screamer 0:66f3b5499f7f 291 tc.add_skipped_info(message, _stdout)
screamer 0:66f3b5499f7f 292 elif test_result['result'] != 'OK':
screamer 0:66f3b5499f7f 293 tc.add_error_info(message, _stdout)
screamer 0:66f3b5499f7f 294
screamer 0:66f3b5499f7f 295 test_cases.append(tc)
screamer 0:66f3b5499f7f 296
screamer 0:66f3b5499f7f 297 ts = TestSuite("test.suite.%s.%s"% (target, toolchain), test_cases, properties=test_suite_properties[target][toolchain])
screamer 0:66f3b5499f7f 298 test_suites.append(ts)
screamer 0:66f3b5499f7f 299 return TestSuite.to_xml_string(test_suites)
screamer 0:66f3b5499f7f 300
screamer 13:ab47a20b66f0 301 def exporter_print_helper(self, array, print_log=False):
screamer 0:66f3b5499f7f 302 for item in array:
screamer 0:66f3b5499f7f 303 print " * %s::%s::%s" % (item["target_name"], item["toolchain_name"], item["id"])
screamer 13:ab47a20b66f0 304 if print_log:
screamer 13:ab47a20b66f0 305 log_lines = item["output"].split("\n")
screamer 13:ab47a20b66f0 306 for log_line in log_lines:
screamer 13:ab47a20b66f0 307 print " %s" % log_line
screamer 0:66f3b5499f7f 308
screamer 13:ab47a20b66f0 309 def exporter_print(self, test_result_ext, print_log_for_failures=False):
screamer 0:66f3b5499f7f 310 """ Export test results in print format.
screamer 0:66f3b5499f7f 311 """
screamer 0:66f3b5499f7f 312 failures = []
screamer 0:66f3b5499f7f 313 skips = []
screamer 0:66f3b5499f7f 314 successes = []
screamer 0:66f3b5499f7f 315
screamer 0:66f3b5499f7f 316 unique_test_ids = self.get_all_unique_test_ids(test_result_ext)
screamer 0:66f3b5499f7f 317 targets = sorted(test_result_ext.keys())
screamer 0:66f3b5499f7f 318
screamer 0:66f3b5499f7f 319 for target in targets:
screamer 0:66f3b5499f7f 320 toolchains = sorted(test_result_ext[target].keys())
screamer 0:66f3b5499f7f 321 for toolchain in toolchains:
screamer 0:66f3b5499f7f 322 tests = sorted(test_result_ext[target][toolchain].keys())
screamer 0:66f3b5499f7f 323 for test in tests:
screamer 0:66f3b5499f7f 324 test_runs = test_result_ext[target][toolchain][test]
screamer 0:66f3b5499f7f 325 for test_runner in test_runs:
screamer 0:66f3b5499f7f 326 #test_run = test_result_ext[target][toolchain][test][test_run_number][0]
screamer 0:66f3b5499f7f 327 test_run = test_runner[0]
screamer 13:ab47a20b66f0 328
screamer 13:ab47a20b66f0 329 if "result" in test_run:
screamer 13:ab47a20b66f0 330 if test_run["result"] == "FAIL":
screamer 13:ab47a20b66f0 331 failures.append(test_run)
screamer 13:ab47a20b66f0 332 elif test_run["result"] == "SKIP" or test_run["result"] == "NOT_SUPPORTED":
screamer 13:ab47a20b66f0 333 skips.append(test_run)
screamer 13:ab47a20b66f0 334 elif test_run["result"] == "OK":
screamer 13:ab47a20b66f0 335 successes.append(test_run)
screamer 13:ab47a20b66f0 336 else:
screamer 13:ab47a20b66f0 337 raise Exception("Unhandled result type: %s" % (test_run["result"]))
screamer 0:66f3b5499f7f 338 else:
screamer 13:ab47a20b66f0 339 raise Exception("'test_run' did not have a 'result' value")
screamer 0:66f3b5499f7f 340
screamer 0:66f3b5499f7f 341 if successes:
screamer 0:66f3b5499f7f 342 print "\n\nBuild successes:"
screamer 0:66f3b5499f7f 343 self.exporter_print_helper(successes)
screamer 0:66f3b5499f7f 344
screamer 0:66f3b5499f7f 345 if skips:
screamer 0:66f3b5499f7f 346 print "\n\nBuild skips:"
screamer 0:66f3b5499f7f 347 self.exporter_print_helper(skips)
screamer 0:66f3b5499f7f 348
screamer 0:66f3b5499f7f 349 if failures:
screamer 0:66f3b5499f7f 350 print "\n\nBuild failures:"
screamer 13:ab47a20b66f0 351 self.exporter_print_helper(failures, print_log=print_log_for_failures)
screamer 0:66f3b5499f7f 352 return False
screamer 0:66f3b5499f7f 353 else:
screamer 0:66f3b5499f7f 354 return True