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

Side by Side Diff: testing/tools/test_runner.py

Issue 2629943002: Ensures that the gold output directory exists (Closed)
Patch Set: Fixed bug for failing pdfium_test runs Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « testing/tools/gold.py ('k') | 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/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The PDFium Authors. All rights reserved. 2 # Copyright 2016 The PDFium 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 import cStringIO 6 import cStringIO
7 import functools 7 import functools
8 import multiprocessing 8 import multiprocessing
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 cmd_to_run = common.DrMemoryWrapper(self.drmem_wrapper, input_root) 120 cmd_to_run = common.DrMemoryWrapper(self.drmem_wrapper, input_root)
121 cmd_to_run.extend([self.pdfium_test_path, '--send-events', '--png']) 121 cmd_to_run.extend([self.pdfium_test_path, '--send-events', '--png'])
122 if self.gold_results: 122 if self.gold_results:
123 cmd_to_run.append('--md5') 123 cmd_to_run.append('--md5')
124 cmd_to_run.append(pdf_path) 124 cmd_to_run.append(pdf_path)
125 return common.RunCommandExtractHashedFiles(cmd_to_run) 125 return common.RunCommandExtractHashedFiles(cmd_to_run)
126 126
127 def HandleResult(self, input_filename, input_path, result): 127 def HandleResult(self, input_filename, input_path, result):
128 if self.gold_results: 128 if self.gold_results:
129 success, image_paths = result 129 success, image_paths = result
130 for img_path, md5_hash in image_paths: 130 if image_paths:
131 # the output filename (without extension becomes the test name) 131 for img_path, md5_hash in image_paths:
132 test_name = os.path.splitext(os.path.split(img_path)[1])[0] 132 # the output filename (without extension becomes the test name)
133 self.gold_results.AddTestResult(test_name, md5_hash, img_path) 133 test_name = os.path.splitext(os.path.split(img_path)[1])[0]
134 self.gold_results.AddTestResult(test_name, md5_hash, img_path)
134 135
135 if self.test_suppressor.IsResultSuppressed(input_filename): 136 if self.test_suppressor.IsResultSuppressed(input_filename):
136 if result: 137 if result:
137 self.surprises.append(input_path) 138 self.surprises.append(input_path)
138 else: 139 else:
139 if not result: 140 if not result:
140 self.failures.append(input_path) 141 self.failures.append(input_path)
141 142
142 143
143 def Run(self): 144 def Run(self):
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 print surprise; 263 print surprise;
263 264
264 if self.failures: 265 if self.failures:
265 self.failures.sort() 266 self.failures.sort()
266 print '\n\nSummary of Failures:' 267 print '\n\nSummary of Failures:'
267 for failure in self.failures: 268 for failure in self.failures:
268 print failure 269 print failure
269 if not options.ignore_errors: 270 if not options.ignore_errors:
270 return 1 271 return 1
271 return 0 272 return 0
OLDNEW
« no previous file with comments | « testing/tools/gold.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698