Skip to content

Commit 59fda38

Browse files
committed
add lua version specific test commands to makefile
1 parent 475984f commit 59fda38

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ scgi_temp/
1111
uwsgi_temp/
1212
*.rockspec
1313
*.rock
14+
luarocks51/
15+
luarocks52/
16+
luarocks53/

Makefile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
.PHONY: test local build global watch lint test_db mysql_test_db clean
2+
.PHONY: test local build lint test_db mysql_test_db clean test_lua51 test_lua52 test_lua53 clean_luarocks
33

44
test:
55
busted spec
@@ -10,17 +10,32 @@ test:
1010
local: build
1111
luarocks --lua-version=5.1 make --force --local lapis-dev-1.rockspec
1212

13-
global: build
14-
sudo luarocks --lua-version=5.1 make lapis-dev-1.rockspec
13+
clean_luarocks:
14+
rm -rf luarocks51 luarocks52 luarocks53
15+
16+
luarocks5%:
17+
@echo "$$(tput setaf 3)Preparing Luarocks for 5.$*$$(tput sgr0)"
18+
luarocks --lua-version=5.$* --tree=luarocks5$* install busted
19+
luarocks --lua-version=5.$* --tree=luarocks5$* install moonscript
20+
luarocks --lua-version=5.$* --tree=luarocks5$* install https://raw.githubusercontent.com/leafo/lua-cjson/master/lua-cjson-dev-1.rockspec
21+
22+
test_lua51: luarocks51 build
23+
luarocks --lua-version=5.1 --tree=luarocks51 make lapis-dev-1.rockspec
24+
LUA_PATH="$$(luarocks --lua-version=5.1 path --lr-path);;" LUA_CPATH="$$(luarocks --lua-version=5.1 path --lr-cpath);;" luarocks51/bin/busted spec
25+
26+
test_lua52: luarocks52 build
27+
luarocks --lua-version=5.2 --tree=luarocks52 make lapis-dev-1.rockspec
28+
LUA_PATH="$$(luarocks --lua-version=5.2 path --lr-path);;" LUA_CPATH="$$(luarocks --lua-version=5.2 path --lr-cpath);;" luarocks52/bin/busted spec
29+
30+
test_lua53: luarocks53 build
31+
luarocks --lua-version=5.3 --tree=luarocks53 make lapis-dev-1.rockspec
32+
LUA_PATH="$$(luarocks --lua-version=5.3 path --lr-path);;" LUA_CPATH="$$(luarocks --lua-version=5.3 path --lr-cpath);;" luarocks53/bin/busted spec
1533

1634
build:
1735
moonc lapis
1836
moonc spec_openresty/s2
1937
moonc spec_mysql/models.moon
2038

21-
watch: build
22-
moonc -w lapis
23-
2439
lint:
2540
moonc lint_config.moon
2641
moonc -l $$(find lapis | grep moon$$)

0 commit comments

Comments
 (0)