summaryrefslogtreecommitdiff
path: root/framework/process.py
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-01-11 14:52:27 -0800
committerKenneth Graunke <kenneth@whitecape.org>2013-01-11 15:05:27 -0800
commit6e3b1330a975ae46d3e180ed4c444075371b9fa8 (patch)
tree16e2e160239199c05f025523adcfa67fe42ba6dd /framework/process.py
parent8e65e2c49c2f5a40b2fb99efaabb6ab853b14e3d (diff)
Make Piglit run in the proper directoryHEADmaster
Diffstat (limited to 'framework/process.py')
-rw-r--r--framework/process.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/framework/process.py b/framework/process.py
index efe2b26..7423769 100644
--- a/framework/process.py
+++ b/framework/process.py
@@ -28,7 +28,7 @@ from threading import Thread
__all__ = ['runProgram']
-def runProgram(cmd, timeout, env = None):
+def runProgram(cmd, timeout, workingDir = None, env = None):
'''Run a program with a timeout in case it never terminates.
cmd -- List of command and arguments. See subprocess.Popen.
@@ -47,7 +47,7 @@ def runProgram(cmd, timeout, env = None):
out = ''
err = ''
try:
- proc = Popen(cmd, stdout=PIPE, stderr=PIPE, env=fullEnv,
+ proc = Popen(cmd, stdout=PIPE, stderr=PIPE, cwd=workingDir, env=fullEnv,
start_new_session=True, universal_newlines=True)
out, err = proc.communicate(timeout=timeout)
return (out, err, proc.returncode, True)