Update build.py to support jats

This commit is contained in:
Productive2 2021-01-29 18:42:45 +01:00
parent 619873f01f
commit 29858360eb
1 changed files with 16 additions and 9 deletions

View File

@ -157,8 +157,15 @@ def build(path: str, flags: Dict[str, str] = {}, options: Dict[str, bool] = {},
logging.info("Running tests under tests/")
logging.debug("Compiling test suite")
start = time()
tests_path = "./tests/runtests" if os.name != "nt" else ".\tests\runtests"
_, stderr, status = run_command(f"nim compile {tests_path}", stdout=DEVNULL, stderr=PIPE)
test_runner_path = "./tests/jatr" if os.name != "nt" else ".\tests\jatr"
tests_path = "./tests/jats" if os.name != "nt" else ".\tests\jats"
command = "nim {flags} compile {path}".format(flags=nim_flags, path=test_runner_path)
_, stderr, status = run_command(command, stdout=DEVNULL, stderr=PIPE)
if status != 0:
logging.error(f"Command '{command}' exited with non-0 exit code {status}, output below:\n{stderr.decode()}")
else:
command = f"nim compile {tests_path}"
_, stderr, status = run_command(command, stdout=DEVNULL, stderr=PIPE)
if status != 0:
logging.error(f"Command '{command}' exited with non-0 exit code {status}, output below:\n{stderr.decode()}")
else: