-
Notifications
You must be signed in to change notification settings - Fork 19
/
lakefile
39 lines (33 loc) · 932 Bytes
/
lakefile
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
PROJECT = 'path'
J = J or path.join
if LUA_VER == '5.3' then
LUA_DIR = ENV.LUA_DIR_5_3 or ENV.LUA_DIR
LUA_RUNNER = 'lua53'
elseif LUA_VER == '5.2' then
LUA_DIR = ENV.LUA_DIR_5_2 or ENV.LUA_DIR
LUA_RUNNER = 'lua52'
else
LUA_DIR = ENV.LUA_DIR
LUA_RUNNER = 'lua'
end
ROOT = ROOT or J(LUA_DIR,'libs',PROJECT)
LUADIR = LUADIR or J(ROOT, 'lua')
install = target('install', {
file.group{odir= LUADIR; recurse = true; src = J('lua', '*.*' )};
file.group{odir=J(ROOT, 'test'); recurse = true; src = J('test', '*.*' )};
})
local function run(file, cwd)
print()
print("run " .. file)
if not TESTING then
if cwd then lake.chdir(cwd) end
os.execute( LUA_RUNNER .. ' ' .. file )
if cwd then lake.chdir("<") end
print()
end
end
target('test', install, function()
local test_dir = J(ROOT,'test')
run(J(test_dir,'run.lua'), test_dir)
run(J(test_dir,'test_lfs.lua'), test_dir)
end)