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

Unified Diff: testing/tools/run_corpus_tests.py

Issue 1011243002: Merge to XFA: Return OS status code from python test driver scripts. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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 674334f33ef4b7f097428fd6386bf5099c63c575..2f6de0721252cd8917be532848b0e8d64958b693 100755
--- a/testing/tools/run_corpus_tests.py
+++ b/testing/tools/run_corpus_tests.py
@@ -39,6 +39,8 @@ def test_one_file(input_filename, source_dir, working_dir,
i += 1
except subprocess.CalledProcessError as e:
print "FAILURE: " + input_filename + "; " + str(e)
+ return False
+ return True
def main():
parser = optparse.OptionParser()
@@ -83,6 +85,7 @@ def main():
os.makedirs(working_dir)
# test files are under .../pdfium/testing/corpus.
+ os_exit_code = 0
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):
@@ -90,9 +93,11 @@ def main():
if input_file_re.match(input_filename):
input_path = os.path.join(source_dir, input_filename)
if os.path.isfile(input_path):
- test_one_file(input_filename, source_dir, working_dir,
- pdfium_test_path, pdfium_diff_path)
- return 0
+ if not test_one_file(input_filename, source_dir, working_dir,
+ pdfium_test_path, pdfium_diff_path):
+ os_exit_code = 1
+
+ return os_exit_code
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