]>
Witch of Git - ivy/blob - tools/test.py
6 from pathlib
import Path
8 from fmt
import blue
, yellow
10 ROOT
= Path(__file__
).parent
.parent
23 subprocess
.run(args
, check
=True)
27 parser
= argparse
.ArgumentParser(
28 description
="""Run tests for the project
30 If no flags are specified, run all tests.
33 parser
.add_argument("--compiler", action
="store_true")
34 parser
.add_argument("--runtime", action
="store_true")
35 parser
.add_argument("--filetest", action
="store_true")
36 parser
.add_argument("--python", action
="store_true")
37 args
= parser
.parse_args()
39 do_all
= not any(vars(args
).values())
46 # Building and testing the compiler
51 cmd("cargo", "fmt", "--", "--check")
54 cmd("cargo", "test", "--quiet")
58 cmd("cargo", "build", "--release", "--all")
60 header("Build compiler...")
61 cmd("cargo", "build", "--release", "--all")
63 # Building and testing the runtime
69 cmd("cargo", "fmt", "--", "--check")
72 cmd("cargo", "test", "--quiet")
76 cmd("cargo", "build", "--release", "--all")
78 header("Build runtime...")
79 cmd("cargo", "build", "--release", "--all")
84 header("Filetests...")
87 cmd("tools/lit.py", "ivy-examples/", "test/")
89 # Linting the Python scripts
94 cmd("black", "test/", "--check", "--diff", "--color")
97 cmd("isort", "test/", "--check", "--diff", "--color")
100 if __name__
== "__main__":
103 except Exception as e
: