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

Unified Diff: testing/tools/run_pixel_tests.py

Issue 1026903002: Flush stdout before launching sub-processes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Log failures from other two scripts Created 5 years, 9 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
« testing/tools/run_corpus_tests.py ('K') | « testing/tools/run_javascript_tests.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/tools/run_pixel_tests.py
diff --git a/testing/tools/run_pixel_tests.py b/testing/tools/run_pixel_tests.py
index 9bd321b560f1a06d6e98270a181bc6e65766b371..7a13820d1827f49e5d3181742b0e58781c05749f 100755
--- a/testing/tools/run_pixel_tests.py
+++ b/testing/tools/run_pixel_tests.py
@@ -24,6 +24,7 @@ def generate_and_test(input_filename, source_dir, working_dir,
expected_path_template = os.path.join(source_dir,
input_root + '_expected.pdf.%d.png')
try:
+ sys.stdout.flush()
subprocess.check_call(
[fixup_path, '--output-dir=' + working_dir, input_path])
subprocess.check_call([pdfium_test_path, '--png', pdf_path])
@@ -36,6 +37,7 @@ def generate_and_test(input_filename, source_dir, working_dir,
print "WARNING: no expected results files found for " + input_filename
break
print "Checking " + actual_path
+ sys.stdout.flush()
subprocess.check_call([pdfium_diff_path, expected_path, actual_path])
i += 1
except subprocess.CalledProcessError as e:
@@ -56,7 +58,7 @@ def main():
if (os.path.basename(my_dir) != 'tools' or
os.path.basename(testing_dir) != 'testing'):
print 'Confused, can not find pdfium root directory, aborting.'
- return 1
+ return 2
# Other scripts are found in the same directory as this one.
fixup_path = os.path.join(my_dir, 'fixup_pdf_template.py')
@@ -92,7 +94,7 @@ def main():
if not os.path.exists(working_dir):
os.makedirs(working_dir)
- os_exit_code = 0
+ failures = []
input_file_re = re.compile('^[a-zA-Z0-9_.]+[.]in$')
for input_filename in os.listdir(source_dir):
if input_file_re.match(input_filename):
@@ -100,10 +102,14 @@ def main():
if os.path.isfile(input_path):
if not generate_and_test(input_filename, source_dir, working_dir,
fixup_path, pdfium_test_path, pdfium_diff_path):
- os_exit_code = 1
-
- return os_exit_code
+ failures.append(input_path)
+ if failures:
+ print '\n\nSummary of Failures:'
+ for failure in failures:
+ print failure
+ return 2
+ return 0
if __name__ == '__main__':
sys.exit(main())
« testing/tools/run_corpus_tests.py ('K') | « testing/tools/run_javascript_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698