...
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: build
23 go test -v ${SRC_PKGS}
24
25check:
26 go vet ${SRC_PKGS}
27 golint ${SRC_PKGS}
28 golangci-lint run
29
30htmlc:
31 go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov
32
33buildfuzz:
34 go-fuzz-build github.com/jmespath/go-jmespath/fuzz
35
36fuzz: buildfuzz
37 go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata
38
39bench:
40 go test -bench . -cpuprofile cpu.out
41
42pprof-cpu:
43 go tool pprof ./go-jmespath.test ./cpu.out
44
45install-dev-cmds:
46 go install golang.org/x/lint/golint@latest
47 go install golang.org/x/tools/cmd/stringer@latest
48 command -v golangci-lint || { curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.46.2; }
View as plain text