chore(coverage): update coverage command. (#354)

* chore(coverage): update coverage command.

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2018-04-22 09:17:16 +08:00
committed by GitHub
parent ffa8eb12b3
commit 672ac28d8f
3 changed files with 33 additions and 13 deletions

View File

@@ -112,8 +112,19 @@ misspell-check: $(MISSPELL)
misspell: $(MISSPELL)
$(MISSPELL) -w $(GOFILES)
test: fmt-check
for PKG in $(PACKAGES); do $(GO) test -v -cover -coverprofile $$GOPATH/src/$$PKG/coverage.txt $$PKG || exit 1; done;
.PHONY: coverage
coverage:
@hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/wadey/gocovmerge; \
fi
gocovmerge $(shell find . -type f -name "coverage.out") > coverage.all;\
.PHONY: unit-test-coverage
unit-test-coverage: init
for PKG in $(PACKAGES); do $(GO) test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
test: init
for PKG in $(PACKAGES); do $(GO) test -v $$PKG || exit 1; done;
.PHONY: test-vendor
test-vendor: $(GOVENDOR)