-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmake_and_test.py
43 lines (33 loc) · 979 Bytes
/
make_and_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
43
import platform
import sys
import os
import os.path
import make
def getAppName():
if platform.system().lower().find('windows') >= 0:
return 'luaexec.exe'
else:
return './luaexec'
def unittest():
print("UnitTest started ...\n")
return os.system(getAppName() + " $")
def installLuaexeclib(ci = False):
if ci:
return os.system(getAppName() + " install_luaexeclib_ci.lua")
else:
return os.system(getAppName() + " install_luaexeclib.lua")
def luatest():
return os.system(getAppName() + " lua_test/lua_test.lua")
if __name__ == "__main__":
if os.path.isfile(getAppName()):
print('Delete ' + getAppName())
os.remove(getAppName())
if make.make() != 0:
sys.exit(-1)
if unittest() != 0:
sys.exit(-1)
if installLuaexeclib(len(sys.argv) > 1 and sys.argv[1].lower() == 'ci') != 0:
sys.exit(-1)
if luatest() != 0:
sys.exit(-1)
sys.exit(0)