| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 | 6 |
| 7 """Parses and displays the contents of one or more autoserv result directories. | 7 """Parses and displays the contents of one or more autoserv result directories. |
| 8 | 8 |
| 9 This script parses the contents of one or more autoserv results folders and | 9 This script parses the contents of one or more autoserv results folders and |
| 10 generates test reports. | 10 generates test reports. |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 total_tests = len(tests) | 206 total_tests = len(tests) |
| 207 percent_pass = 100 * tests_pass / total_tests | 207 percent_pass = 100 * tests_pass / total_tests |
| 208 pass_str = '%d/%d (%d%%)' % (tests_pass, total_tests, percent_pass) | 208 pass_str = '%d/%d (%d%%)' % (tests_pass, total_tests, percent_pass) |
| 209 print 'Total PASS: ' + self._color.Color(Color.BOLD, pass_str) | 209 print 'Total PASS: ' + self._color.Color(Color.BOLD, pass_str) |
| 210 | 210 |
| 211 # Print out the client debug information for failed tests. | 211 # Print out the client debug information for failed tests. |
| 212 if self._options.print_debug: | 212 if self._options.print_debug: |
| 213 for test in tests_with_errors: | 213 for test in tests_with_errors: |
| 214 debug_file_regex = os.path.join(self._options.strip, test, 'debug', | 214 debug_file_regex = os.path.join(self._options.strip, test, 'debug', |
| 215 'client.*.DEBUG') | 215 '%s*.DEBUG' % os.path.basename(test)) |
| 216 for path in glob.glob(debug_file_regex): | 216 for path in glob.glob(debug_file_regex): |
| 217 try: | 217 try: |
| 218 fh = open(path) | 218 fh = open(path) |
| 219 print ('\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( | 219 print ('\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( |
| 220 path, test)) | 220 path, test)) |
| 221 print fh.read() | 221 print fh.read() |
| 222 print('\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( | 222 print('\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( |
| 223 path, test)) | 223 path, test)) |
| 224 fh.close() | 224 fh.close() |
| 225 except: | 225 except: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if not args: | 261 if not args: |
| 262 parser.print_help() | 262 parser.print_help() |
| 263 Die('no result directories provided') | 263 Die('no result directories provided') |
| 264 | 264 |
| 265 generator = ReportGenerator(options, args) | 265 generator = ReportGenerator(options, args) |
| 266 generator.Run() | 266 generator.Run() |
| 267 | 267 |
| 268 | 268 |
| 269 if __name__ == '__main__': | 269 if __name__ == '__main__': |
| 270 main() | 270 main() |
| OLD | NEW |