github.com/leanovate/gopter@v0.2.9/Makefile (about)

     1  PACKAGES=$(shell go list ./...)
     2  
     3  all: format
     4  	@go get github.com/smartystreets/goconvey
     5  	@go build -v ./...
     6  
     7  format:
     8  	@echo "--> Running go fmt"
     9  	@gofmt -s -w .
    10  
    11  test:
    12  	@echo "--> Running tests"
    13  	@go test -v ./... -count=1
    14  	@$(MAKE) vet
    15  
    16  coverage:
    17  	@echo "--> Running tests with coverage"
    18  	@echo "" > coverage.txt
    19  	for pkg in $(shell go list ./...); do \
    20  		(go test -coverprofile=.pkg.coverage -covermode=atomic -v $$pkg && \
    21  		cat .pkg.coverage >> coverage.txt) || exit 1; \
    22  	done
    23  	@rm .pkg.coverage
    24  	@$(MAKE) vet
    25  
    26  vet:
    27  	@go vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
    28      	go get golang.org/x/tools/cmd/vet; \
    29      fi
    30  	@echo "--> Running go vet $(VETARGS)"
    31  	@find . -name "*.go" | grep -v "./Godeps/" | xargs go vet $(VETARGS); if [ $$? -eq 1 ]; then \
    32  		echo ""; \
    33  		echo "Vet found suspicious constructs. Please check the reported constructs"; \
    34  		echo "and fix them if necessary before submitting the code for reviewal."; \
    35  	fi
    36  
    37  refreshGodoc:
    38  	@echo "--> Refreshing godoc.org"
    39  	for pkg in $(shell go list ./...); do \
    40  		curl -d "path=$$pkg" https://godoc.org/-/refresh ; \
    41  	done