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

Unified Diff: testing/tools/run_corpus_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
« no previous file with comments | « no previous file | testing/tools/run_javascript_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/tools/run_corpus_tests.py
diff --git a/testing/tools/run_corpus_tests.py b/testing/tools/run_corpus_tests.py
index 2f6de0721252cd8917be532848b0e8d64958b693..3295405e5336be8452a36a23722ded1bfa973a70 100755
--- a/testing/tools/run_corpus_tests.py
+++ b/testing/tools/run_corpus_tests.py
@@ -24,6 +24,7 @@ def test_one_file(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(['cp', input_path, pdf_path])
subprocess.check_call([pdfium_test_path, '--png', pdf_path])
i = 0;
@@ -35,6 +36,7 @@ def test_one_file(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:
@@ -55,7 +57,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
# Find path to build directory. This depends on whether this is a
# standalone build vs. a build as part of a chromium checkout. For
@@ -85,7 +87,7 @@ def main():
os.makedirs(working_dir)
# test files are under .../pdfium/testing/corpus.
- os_exit_code = 0
+ failures = []
walk_from_dir = os.path.join(testing_dir, 'corpus');
input_file_re = re.compile('^[a-zA-Z0-9_.]+[.]pdf$')
for source_dir, _, filename_list in os.walk(walk_from_dir):
@@ -95,9 +97,15 @@ def main():
if os.path.isfile(input_path):
if not test_one_file(input_filename, source_dir, working_dir,
pdfium_test_path, pdfium_diff_path):
- os_exit_code = 1
+ failures.append(input_path)
- return os_exit_code
+ if failures:
+ print '\n\nSummary of Failures:'
Lei Zhang 2015/03/20 21:22:33 Maybe print out an easily recognized header and fo
+ for failure in failures:
+ print failure
+ return 2
+
+ return 0
if __name__ == '__main__':
« no previous file with comments | « no previous file | testing/tools/run_javascript_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698