Permalink
263e459 Nov 28, 2016
@thibaultcha @thefosk @Tieske
44 lines (35 sloc) 1004 Bytes
DEV_ROCKS = busted luacheck lua-llthreads2
BUSTED_ARGS ?= -v
TEST_CMD ?= bin/busted $(BUSTED_ARGS)
OPENSSL_DIR ?= /usr/local/opt/openssl
.PHONY: install dev lint test test-integration test-plugins test-all
install:
@luarocks make OPENSSL_DIR=$(OPENSSL_DIR)
dev: install
@for rock in $(DEV_ROCKS) ; do \
if ! luarocks list | grep $$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 \
--ignore 6..
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/