1
2CMD = jpgo
3
4SRC_PKGS=./ ./cmd/... ./fuzz/...
5
6help:
7	@echo "Please use \`make <target>' where <target> is one of"
8	@echo "  test                    to run all the tests"
9	@echo "  build                   to build the library and jp executable"
10	@echo "  generate                to run codegen"
11
12
13generate:
14	go generate ${SRC_PKGS}
15
16build:
17	rm -f $(CMD)
18	go build ${SRC_PKGS}
19	rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./...
20	mv cmd/$(CMD)/$(CMD) .
21
22test: test-internal-testify
23	echo "making tests ${SRC_PKGS}"
24	go test -v ${SRC_PKGS}
25
26check:
27	go vet ${SRC_PKGS}
28	@echo "golint ${SRC_PKGS}"
29	@lint=`golint ${SRC_PKGS}`; \
30	lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \
31	echo "$$lint"; \
32	if [ "$$lint" != "" ]; then exit 1; fi
33
34htmlc:
35	go test -coverprofile="/tmp/jpcov"  && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov
36
37buildfuzz:
38	go-fuzz-build github.com/jmespath/go-jmespath/fuzz
39
40fuzz: buildfuzz
41	go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata
42
43bench:
44	go test -bench . -cpuprofile cpu.out
45
46pprof-cpu:
47	go tool pprof ./go-jmespath.test ./cpu.out
48
49test-internal-testify:
50	cd internal/testify && go test ./...
51
52