Commit d31a6b43 authored by Tatiana Buldina's avatar Tatiana Buldina Committed by Commit Bot

[ChromeDriver] Run Java tests without Ant

Change-Id: Iec38375f55151e73cc3bb72683d1b4ee3cb2b01a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721852Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tatiana Buldina <buldina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709264}
parent 0905cf77
......@@ -166,10 +166,11 @@ def Kill(pid):
os.kill(pid, signal.SIGTERM)
def RunCommand(cmd, cwd=None):
def RunCommand(cmd, cwd=None, fileName=None):
"""Runs the given command and returns the exit code.
Args:
fileName: file name to redirect output
cmd: list of command arguments.
cwd: working directory to execute the command, or None if the current
working directory should be used.
......@@ -178,7 +179,11 @@ def RunCommand(cmd, cwd=None):
The exit code of the command.
"""
sys.stdout.flush()
process = subprocess.Popen(cmd, cwd=cwd)
if fileName is not None:
with open(fileName,"wb") as out:
process = subprocess.Popen(cmd, cwd=cwd,stdout=out,stderr=out)
else:
process = subprocess.Popen(cmd, cwd=cwd)
process.wait()
sys.stdout.flush()
return process.returncode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment