1
0
Fork 0
tplp-planning-benchmark/benchmark-new/benchmark.py

24 lines
774 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"])
2018-06-24 03:47:57 +02:00
benchmarkRepository.writeStatus("test status")
2018-06-22 14:27:25 +02:00
if __name__ == "__main__":
main()