Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Side by Side Diff: generate_test_report.py

Issue 4088007: Add direct flush calls to stderr / stdout. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Fix comments Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698