From 107cacecf207a7dc6e98b4d42a0b02fb9fb7fec3 Mon Sep 17 00:00:00 2001 From: hefee <me@hefee.de> Date: Thu, 22 Mar 2018 16:13:22 +0100 Subject: [PATCH] add python scripts to run tests. --- runtests.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 runtests.py diff --git a/runtests.py b/runtests.py new file mode 100644 index 0000000..c691fbf --- /dev/null +++ b/runtests.py @@ -0,0 +1,15 @@ +import os +import shutil +import subprocess +import tempfile + +def runTest(name): + with tempfile.TemporaryDirectory() as d: + shutil.copyfile(f"tests/{name}/base", f"{d}/base") + shutil.copyfile(f"tests/{name}/pot", f"{d}/pot") + shutil.copyfile(f"tests/{name}/local", f"{d}/local") + shutil.copyfile(f"tests/{name}/remote", f"{d}/remote") + cmd = ["./mergetool", f"{d}/base", f"{d}/local", f"{d}/remote"] + print(subprocess.call(cmd)) + cmd = ["diff", "-u", f"{d}/local", f"tests/{name}/merged"] + return subprocess.call(cmd) -- GitLab