-
Notifications
You must be signed in to change notification settings - Fork 2
/
travis.py
32 lines (27 loc) · 933 Bytes
/
travis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python3.9
from pathlib import Path
import subprocess
import build
import os
import sys
def compile(extra):
args = [build.exe_file("bin/princess2"), "--no-incremental", "-d", "-Isrc", "--buildfolder=build", "--outfile", build.exe_file("bin/princess3"), "src/main.pr"]
args += build.ARGS
subprocess.check_call(args + extra)
def main():
Path("build").mkdir(exist_ok = True)
Path("bin").mkdir(exist_ok = True)
build.download()
print("Building the compiler...")
build.build([])
print("Building test suite...")
build.testrunner([])
print("Running test suite")
# TODO also test on windows
if sys.platform != "win32":
os.environ["PRINCESS_COMPILER"] = build.exe_file("bin/princess2")
subprocess.check_call(["bin/testrunner", "./test", "--compiler", "./bin/princess2"])
print("Bootstrapping...")
compile([])
if __name__ == "__main__":
main()