summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-07-19 00:28:14 +0000
committerEric Fiselier <eric@efcs.ca>2015-07-19 00:28:14 +0000
commit6aa873b392176b4665ebe82918d083bbf68885a2 (patch)
tree1b0d6c78cac52fb85ca64d8260b11a9b88c12e58
parent80fe6bd1426bbee1a7180203897fb247e432166b (diff)
downloadbcm5719-llvm-6aa873b392176b4665ebe82918d083bbf68885a2.tar.gz
bcm5719-llvm-6aa873b392176b4665ebe82918d083bbf68885a2.zip
[LIT] Allow for executeCommand to take the stdin input.
Summary: This patch allows executeCommand to pass a string to the processes stdin. Reviewers: ddunbar, jroelofs Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11332 llvm-svn: 242631
-rw-r--r--llvm/utils/lit/lit/util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/lit/lit/util.py b/llvm/utils/lit/lit/util.py
index 08f7b71ae21..a4233bac7aa 100644
--- a/llvm/utils/lit/lit/util.py
+++ b/llvm/utils/lit/lit/util.py
@@ -48,7 +48,7 @@ def mkdir_p(path):
if not path or os.path.exists(path):
return
- parent = os.path.dirname(path)
+ parent = os.path.dirname(path)
if parent != path:
mkdir_p(parent)
@@ -158,13 +158,13 @@ def printHistogram(items, title = 'Items'):
# Close extra file handles on UNIX (on Windows this cannot be done while
# also redirecting input).
kUseCloseFDs = not (platform.system() == 'Windows')
-def executeCommand(command, cwd=None, env=None):
+def executeCommand(command, cwd=None, env=None, input=None):
p = subprocess.Popen(command, cwd=cwd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env, close_fds=kUseCloseFDs)
- out,err = p.communicate()
+ out,err = p.communicate(input=input)
exitCode = p.wait()
# Detect Ctrl-C in subprocess.
OpenPOWER on IntegriCloud