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

Unified Diff: testing/tools/common.py

Issue 1398793003: Parallelize run_corpus_tests.py. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 2 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/pngdiffer.py » ('j') | testing/tools/run_corpus_tests.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/tools/common.py
diff --git a/testing/tools/common.py b/testing/tools/common.py
index 14745a8a3e62348254e111d9999a35eec3a0ceaf..d45404b4d4dd2a3f7d7094ab903002efa0d411e0 100755
--- a/testing/tools/common.py
+++ b/testing/tools/common.py
@@ -4,6 +4,7 @@
# found in the LICENSE file.
import os
+import subprocess
import sys
def os_name():
@@ -16,6 +17,17 @@ def os_name():
raise Exception('Confused, can not determine OS, aborting.')
+def RunCommand(cmd, redirect_output=False):
+ try:
+ if redirect_output:
+ sys.stdout.write(subprocess.check_output(cmd, stderr=subprocess.STDOUT))
Nathan Parker 2015/10/09 19:55:04 Does the subprocess's stdout go to your modified s
Lei Zhang 2015/10/09 20:14:33 Yes, it seems to go to whatever sys.stdout is set
+ else:
+ subprocess.check_call(cmd)
+ return None
+ except subprocess.CalledProcessError as e:
+ return e
+
+
class DirectoryFinder:
'''A class for finding directories and paths under either a standalone
checkout or a chromium checkout of PDFium.'''
« no previous file with comments | « no previous file | testing/tools/pngdiffer.py » ('j') | testing/tools/run_corpus_tests.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698