| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 while out: | 227 while out: |
| 228 print >> sys.stderr, out | 228 print >> sys.stderr, out |
| 229 out = fh.read() | 229 out = fh.read() |
| 230 print >> sys.stderr, ( | 230 print >> sys.stderr, ( |
| 231 '\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( | 231 '\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( |
| 232 path, test)) | 232 path, test)) |
| 233 fh.close() | 233 fh.close() |
| 234 except: | 234 except: |
| 235 print 'Could not open %s' % path | 235 print 'Could not open %s' % path |
| 236 | 236 |
| 237 # Sometimes the builders exit before these buffers are flushed. |
| 238 sys.stderr.flush() |
| 239 sys.stdout.flush() |
| 240 |
| 237 def Run(self): | 241 def Run(self): |
| 238 """Runs report generation.""" | 242 """Runs report generation.""" |
| 239 self._CollectResults() | 243 self._CollectResults() |
| 240 self._GenerateReportText() | 244 self._GenerateReportText() |
| 241 for v in self._results.itervalues(): | 245 for v in self._results.itervalues(): |
| 242 if v['status'] != 'PASS': | 246 if v['status'] != 'PASS': |
| 243 sys.exit(1) | 247 sys.exit(1) |
| 244 | 248 |
| 245 | 249 |
| 246 def main(): | 250 def main(): |
| (...skipping 23 matching lines...) Expand all Loading... |
| 270 if not args: | 274 if not args: |
| 271 parser.print_help() | 275 parser.print_help() |
| 272 Die('no result directories provided') | 276 Die('no result directories provided') |
| 273 | 277 |
| 274 generator = ReportGenerator(options, args) | 278 generator = ReportGenerator(options, args) |
| 275 generator.Run() | 279 generator.Run() |
| 276 | 280 |
| 277 | 281 |
| 278 if __name__ == '__main__': | 282 if __name__ == '__main__': |
| 279 main() | 283 main() |
| OLD | NEW |