Makefile 1.2 KB

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