From 5e0909abad016c53e4b73ee0b9691eefa477090c Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Fri, 22 Oct 2010 12:34:38 -0700 Subject: [PATCH] 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 --- generate_test_report.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/generate_test_report.py b/generate_test_report.py index 8ff12df24e..97c3ec6f0d 100755 --- a/generate_test_report.py +++ b/generate_test_report.py @@ -216,11 +216,16 @@ class ReportGenerator(object): for path in glob.glob(debug_file_regex): try: fh = open(path) - print ('\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( - path, test)) - print fh.read() - print('\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( - path, test)) + print >> sys.stderr, ( + '\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( + path, test)) + out = fh.read() + while out: + print >> sys.stderr, out + out = fh.read() + print >> sys.stderr, ( + '\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( + path, test)) fh.close() except: print 'Could not open %s' % path