tplp-planning-benchmark/benchmark-new/benchmark.py

23 lines
726 B
Python
Raw Normal View History

2018-06-22 14:27:25 +02:00
#!/usr/bin/python3
import subprocess
import yaml
from benchmark_repository import BenchmarkRepository
def executeCommand(command, stdin = None, cwd = None):
with subprocess.Popen(command, stdout = subprocess.PIPE, stderr = subprocess.PIPE, stdin = (subprocess.PIPE if stdin != None else None), cwd = cwd) as process:
stdout, stderr = process.communicate(input = (stdin.encode("utf-8") if stdin != None else None))
exitCode = process.returncode
return stdout.decode("utf-8"), stderr.decode("utf-8"), exitCode
def main():
with open("config.yml", "r") as stream:
config = yaml.load(stream, Loader = yaml.CLoader)
benchmarkRepository = BenchmarkRepository(config["repository"])
if __name__ == "__main__":
main()