Robustify printing of test errors to stderr.

Change-Id: I1e5da670437ce6574910a34d09b30aa80aee6f4f

BUG=8056
TEST=Ran it with tests that both succeeded and failed.

Review URL: http://codereview.chromium.org/4007008
This commit is contained in:
Chris Sosa 2010-10-22 12:34:38 -07:00
parent 9fe00b9b13
commit 5e0909abad

View File

@ -216,11 +216,16 @@ class ReportGenerator(object):
for path in glob.glob(debug_file_regex): for path in glob.glob(debug_file_regex):
try: try:
fh = open(path) fh = open(path)
print ('\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( print >> sys.stderr, (
path, test)) '\n========== DEBUG FILE %s FOR TEST %s ==============\n' % (
print fh.read() path, test))
print('\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( out = fh.read()
path, test)) while out:
print >> sys.stderr, out
out = fh.read()
print >> sys.stderr, (
'\n=========== END DEBUG %s FOR TEST %s ===============\n' % (
path, test))
fh.close() fh.close()
except: except:
print 'Could not open %s' % path print 'Could not open %s' % path