From 6f3c2ffd369af00e1a4f0ac5413b816f464cba78 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 9 Oct 2015 13:49:17 -0700 Subject: Merge to XFA: Parallelize run_corpus_tests.py. - Use the number of cores as the default -j value - Fall back to old code for -j 1 TBR=nparker@chromium.org Review URL: https://codereview.chromium.org/1398793003 . (cherry picked from commit fd751f28cecce61ab36038799043639d570e0b26) Review URL: https://codereview.chromium.org/1395253002 . --- testing/tools/common.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testing/tools/common.py') diff --git a/testing/tools/common.py b/testing/tools/common.py index 14745a8a3e..d45404b4d4 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)) + 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.''' -- cgit v1.2.3