-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
executable file
·42 lines (31 loc) · 1.1 KB
/
test.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
40
41
42
#!/usr/bin/env python3
import platform
import subprocess
from pathlib import Path
def test_arm64_mac_binaries():
here = Path(__file__).parent.resolve()
subprocess.run(["ninja", "test"], cwd=f"{here}/build/arm64-mac", check=True)
def test_x64_mac_binaries():
here = Path(__file__).parent.resolve()
subprocess.run(["ninja", "test"], cwd=f"{here}/build/x64-mac", check=True)
def test_x64_linux_binaries():
here = Path(__file__).parent.resolve()
subprocess.run(["ninja", "test"], cwd=f"{here}/build/x64-linux", check=True)
def main():
if platform.system() == "Windows":
# TODO: implement
return
if platform.system() == "Darwin":
if platform.machine() == "arm64":
test_arm64_mac_binaries()
# Arm64 Mac can run x64 Mac programs.
test_x64_mac_binaries()
elif platform.machine() == "x86_64":
test_x64_mac_binaries()
return
elif platform.system() == "Linux":
test_x64_linux_binaries()
return
raise Exception(f"librgbd test not supported.")
if __name__ == "__main__":
main()