-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (40 loc) · 1.51 KB
/
Makefile
File metadata and controls
52 lines (40 loc) · 1.51 KB
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
48
49
50
51
52
INST_PREFIX ?= /usr/local/openresty
INST_LUADIR ?= $(INST_PREFIX)/lualib
INSTALL ?= install
RESTY := /usr/local/openresty/bin/resty --shdict "test 1m"
UNIT_TESTS := $(sort $(wildcard t/unit/test_*.lua))
CONFORMANCE_TESTS := $(sort $(wildcard t/conformance/test_*.lua))
.PHONY: test test-unit test-conformance lint dev install clean help
### help: Show Makefile rules
help:
@echo Makefile rules:
@echo
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'
### dev: Create a development ENV
dev:
luarocks install rockspec/lua-resty-openapi-validator-master-0.1-0.rockspec --only-deps --local
### install: Install the library to runtime
install:
$(INSTALL) -d $(INST_LUADIR)/resty/openapi_validator/
$(INSTALL) lib/resty/openapi_validator/*.lua $(INST_LUADIR)/resty/openapi_validator/
### test: Run all tests
test: test-unit test-conformance
@echo "All tests passed."
### test-unit: Run unit tests
test-unit:
@echo "=== Unit tests ==="
@for f in $(UNIT_TESTS); do $(RESTY) -e "dofile('$$f')" || exit 1; done
### test-conformance: Run conformance tests
test-conformance:
@echo "=== Conformance tests ==="
@for f in $(CONFORMANCE_TESTS); do $(RESTY) -e "dofile('$$f')" || exit 1; done
### lint: Lint Lua source code
lint:
luacheck -q lib/
### fuzz: Run mutation fuzzer (FUZZ_BUDGET seconds, default 60)
FUZZ_BUDGET ?= 60
fuzz:
python3 fuzz/mutate_fuzz.py --budget $(FUZZ_BUDGET) --out fuzz/out
### clean: Remove build artifacts
clean:
rm -rf *.rock fuzz/out