src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

Makefile (1186B)


      1 
      2 CMD = jpgo
      3 
      4 SRC_PKGS=./ ./cmd/... ./fuzz/...
      5 
      6 help:
      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 
     13 generate:
     14 	go generate ${SRC_PKGS}
     15 
     16 build:
     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 
     22 test: test-internal-testify
     23 	echo "making tests ${SRC_PKGS}"
     24 	go test -v ${SRC_PKGS}
     25 
     26 check:
     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 
     34 htmlc:
     35 	go test -coverprofile="/tmp/jpcov"  && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov
     36 
     37 buildfuzz:
     38 	go-fuzz-build github.com/jmespath/go-jmespath/fuzz
     39 
     40 fuzz: buildfuzz
     41 	go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata
     42 
     43 bench:
     44 	go test -bench . -cpuprofile cpu.out
     45 
     46 pprof-cpu:
     47 	go tool pprof ./go-jmespath.test ./cpu.out
     48 
     49 test-internal-testify:
     50 	cd internal/testify && go test ./...
     51