-
Notifications
You must be signed in to change notification settings - Fork 9
/
tests.py
37 lines (30 loc) · 1001 Bytes
/
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
import glob
import subprocess
import sys
if __name__ == "__main__":
blenderExecutable = "blender"
# allow override of blender executable (important for CI!)
if len(sys.argv) > 1:
blenderExecutable = sys.argv[1]
# iterate over each *.test.blend file in the "tests" directory
# and open up blender with the .test.blend file
# and the corresponding .test.py python script.
print("start testing...")
gl = glob.glob("./tests/**/*.test.blend")
print("found %s tests: " % len(gl))
errorCode = 0
for file in gl:
# print("executing:", file)
cmd = [
blenderExecutable,
"--addons",
"uv_align_distribute",
"--factory-startup",
"-noaudio",
"-b",
file,
"--python",
file.replace(".blend", ".py"),
]
errorCode |= subprocess.call(cmd, stdout=subprocess.DEVNULL)
exit(errorCode)