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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 '%s*.DEBUG' % os.path.basename(test)) | 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 >> sys.stderr, ( |
220 path, test)) | 220 '\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( |
221 print fh.read() | 221 path, test)) |
222 print('\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( | 222 out = fh.read() |
223 path, test)) | 223 while out: |
| 224 print >> sys.stderr, out |
| 225 out = fh.read() |
| 226 print >> sys.stderr, ( |
| 227 '\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( |
| 228 path, test)) |
224 fh.close() | 229 fh.close() |
225 except: | 230 except: |
226 print 'Could not open %s' % path | 231 print 'Could not open %s' % path |
227 | 232 |
228 def Run(self): | 233 def Run(self): |
229 """Runs report generation.""" | 234 """Runs report generation.""" |
230 self._CollectResults() | 235 self._CollectResults() |
231 self._GenerateReportText() | 236 self._GenerateReportText() |
232 for v in self._results.itervalues(): | 237 for v in self._results.itervalues(): |
233 if v['status'] != 'PASS': | 238 if v['status'] != 'PASS': |
(...skipping 27 matching lines...) Expand all Loading... |
261 if not args: | 266 if not args: |
262 parser.print_help() | 267 parser.print_help() |
263 Die('no result directories provided') | 268 Die('no result directories provided') |
264 | 269 |
265 generator = ReportGenerator(options, args) | 270 generator = ReportGenerator(options, args) |
266 generator.Run() | 271 generator.Run() |
267 | 272 |
268 | 273 |
269 if __name__ == '__main__': | 274 if __name__ == '__main__': |
270 main() | 275 main() |
OLD | NEW |