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

Unified Diff: tools/testing/drt-trampoline.py

Issue 10701025: fixing drt-trampoline (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« tests/html/html.status ('K') | « tests/utils/png_layout_test.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/drt-trampoline.py
diff --git a/tools/testing/drt-trampoline.py b/tools/testing/drt-trampoline.py
index 2c7b033e009e2aa0cc64013d483043f6fabd0b90..89363a565373d05ad09c06b5f74a3e82b21cf3cc 100644
--- a/tools/testing/drt-trampoline.py
+++ b/tools/testing/drt-trampoline.py
@@ -49,19 +49,19 @@ def main(argv):
p = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE)
- p.wait()
Siggi Cherem (dart-lang) 2012/06/28 21:23:57 I believe the issue is related to pipeing output a
Emily Fortuna 2012/06/28 21:44:39 I think you're right. I seem to remember reading i
+ output, error = p.communicate()
if p.returncode != 0:
raise Exception('Failed to run command. return code=%s' % p.returncode)
if out_expected_file:
# Compare output to the given expectation file.
- output = None
expectation = None
- with p.stdout as res:
- if is_png:
- # DRT prints the image to STDOUT, but includes 5 header lines.
- for i in range(4): res.readline()
- output = res.read()
+ if is_png:
+ # DRT prints the image to STDOUT, but includes extra text that we trim:
+ # - 5 header lines
+ # - a '#EOF\n' at the end
+ output = output.replace('\n', '_', 3)
+ output = output[output.find('\n') + 1: -5]
Emily Fortuna 2012/06/28 21:44:39 Perhaps I'm misunderstanding how this code works,
Siggi Cherem (dart-lang) 2012/06/28 21:55:06 Done. Turns out that it was 4 header lines, not 5.
if os.path.exists(out_expected_file):
with open(out_expected_file, 'r') as f:
expectation = f.read()
@@ -87,7 +87,7 @@ def main(argv):
print '#EOF'
else:
# Pipe through the output for non-layout tests.
- sys.stdout.write(p.stdout.read())
+ print output
if __name__ == '__main__':
try:
« tests/html/html.status ('K') | « tests/utils/png_layout_test.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698