forked from Kong/kong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (39 loc) · 1.15 KB
/
Makefile
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
44
45
46
47
DEV_ROCKS = busted luacheck lua-llthreads2
BUSTED_ARGS ?= -v
TEST_CMD ?= bin/busted $(BUSTED_ARGS)
.PHONY: install dev lint test test-integration test-plugins test-all
install:
@if [ `uname` = "Darwin" ]; then \
luarocks make kong-*.rockspec; \
else \
luarocks make kong-*.rockspec \
PCRE_LIBDIR=`find / -type f -name "libpcre.so*" -print -quit | xargs dirname` \
OPENSSL_LIBDIR=`find / -type f -name "libssl.so*" -print -quit | xargs dirname`; \
fi
dev: install
@for rock in $(DEV_ROCKS) ; do \
if ! command -v $$rock > /dev/null ; then \
echo $$rock not found, installing via luarocks... ; \
luarocks install $$rock ; \
else \
echo $$rock already installed, skipping ; \
fi \
done;
lint:
@luacheck -q . \
--exclude-files 'kong/vendor/**/*.lua' \
--exclude-files 'spec/fixtures/invalid-module.lua' \
--std 'ngx_lua+busted' \
--globals '_KONG' \
--globals 'ngx' \
--globals 'assert' \
--no-redefined \
--no-unused-args
test:
@$(TEST_CMD) spec/01-unit
test-integration:
@$(TEST_CMD) spec/02-integration
test-plugins:
@$(TEST_CMD) spec/03-plugins
test-all:
@$(TEST_CMD) spec/