summaryrefslogtreecommitdiff
path: root/testing/tools/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tools/common.py')
-rwxr-xr-xtesting/tools/common.py12
1 files changed, 12 insertions, 0 deletions
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.'''