Skip to content
Snippets Groups Projects
Commit 162b8b38 authored by Daniel Skýpala's avatar Daniel Skýpala
Browse files

Add pisek testing

parent 1ce5e083
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ import task_autotest.config as config ...@@ -7,7 +7,7 @@ import task_autotest.config as config
def test_task_commit(task_path, commit, workdir="_test"): def test_task_commit(task_path, commit, workdir="_test"):
start_time = time.time() start_time = time.time()
wd = config.REPO_DIR + "/" + workdir wd = os.path.join(config.REPO_DIR, workdir)
subprocess.run(["git", "checkout", commit], cwd=wd, check=True) subprocess.run(["git", "checkout", commit], cwd=wd, check=True)
outdir = config.DATA_DIR + "/tests/" + task_path.replace('/', '_') + '/' + commit + '/' outdir = config.DATA_DIR + "/tests/" + task_path.replace('/', '_') + '/' + commit + '/'
...@@ -19,3 +19,16 @@ def test_task_commit(task_path, commit, workdir="_test"): ...@@ -19,3 +19,16 @@ def test_task_commit(task_path, commit, workdir="_test"):
os.mkdir(outdir) os.mkdir(outdir)
with open(outdir + "time", "w") as f: with open(outdir + "time", "w") as f:
f.write(str(int(start_time))) f.write(str(int(start_time)))
def run_pisek(args, output):
return subprocess.run(
["pisek"] + args,
stdout=open(os.path.join(outdir, output), "w"),
stderr=subprocess.STDOUT,
text=True,
cwd=os.path.join(config.REPO_DIR, workdir, task_path),
)
run_pisek(["--output", "--plain"], "output")
run_pisek(["--strict", "--output", "--plain"], "strict_output")
open(os.path.join(outdir, "complete"), "w").close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment