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

Unified Diff: testing/tools/run_javascript_tests.py

Issue 1026903002: Flush stdout before launching sub-processes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: No need to change return os status code 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 | « testing/tools/run_corpus_tests.py ('k') | testing/tools/run_pixel_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/tools/run_javascript_tests.py
diff --git a/testing/tools/run_javascript_tests.py b/testing/tools/run_javascript_tests.py
index ddc82665d56289558cdf8cde1d0996984444176c..fd9cf5f870898230d385254e26045c8f9d49575d 100755
--- a/testing/tools/run_javascript_tests.py
+++ b/testing/tools/run_javascript_tests.py
@@ -23,6 +23,7 @@ def generate_and_test(input_filename, source_dir, working_dir,
txt_path = os.path.join(working_dir, input_root + '.txt')
expected_path = os.path.join(source_dir, input_root + '_expected.txt')
try:
+ sys.stdout.flush()
subprocess.check_call(
[fixup_path, '--output-dir=' + working_dir, input_path])
with open(txt_path, 'w') as outfile:
@@ -80,7 +81,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):
@@ -88,9 +89,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):
- os_exit_code = 1
+ failures.append(input_path)
- return os_exit_code
+ if failures:
+ print '\n\nSummary of Failures:'
+ for failure in failures:
+ print failure
+ return 1
+ return 0
if __name__ == '__main__':
« no previous file with comments | « testing/tools/run_corpus_tests.py ('k') | testing/tools/run_pixel_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698