tplp-planning-benchmark/benchmark-new/benchmark.py
2018-06-24 03:47:57 +02:00

24 lines
774 B
Python
Executable File

#!/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"])
benchmarkRepository.writeStatus("test status")
if __name__ == "__main__":
main()