-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.py
39 lines (32 loc) · 853 Bytes
/
run_tests.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
33
34
35
36
37
38
39
from __future__ import print_function
import subprocess
import sys
tests = [
"pa4/tests/test-mesh.xml",
"pa4/tests/test-mesh-furnace.xml",
"pa5/tests/chi2test-microfacet.xml",
"pa5/tests/ttest-microfacet.xml",
"pa5/tests/test-direct.xml",
"pa5/tests/test-furnace.xml",
]
total = len(tests)
passed = 0
failed = []
for t in tests:
path = "scenes/" + t
ret = subprocess.call(["./build/nori", path])
if ret == 0:
passed += 1
else:
failed.append(t)
print("")
if passed < total:
print("\033[91m" + "Passed " + str(passed) + " / " + str(total) + " tests." + "\033[0m")
print("Failed tests:")
for t in failed:
print("\t" + t)
sys.exit(1)
else:
print("\033[92m" + "Passed " + str(passed) + " / " + str(total) + " tests." + "\033[0m")
print("\tNice!")
sys.exit(0)