chore: add test-coverage and test-show-coverage tasks to makefile
This commit is contained in:
parent
a8139b4b26
commit
8c266a5a20
1 changed files with 11 additions and 1 deletions
12
Makefile
12
Makefile
|
@ -1,4 +1,4 @@
|
||||||
.PHONY: usage build test run tidy release release-all
|
.PHONY: usage build test test-coverage test-show-coverage run tidy release release-all
|
||||||
|
|
||||||
OK_COLOR=\033[32;01m
|
OK_COLOR=\033[32;01m
|
||||||
NO_COLOR=\033[0m
|
NO_COLOR=\033[0m
|
||||||
|
@ -35,6 +35,16 @@ test:
|
||||||
@echo $(ECHOFLAGS) "$(OK_COLOR)==> Running tests...$(NO_COLOR)"
|
@echo $(ECHOFLAGS) "$(OK_COLOR)==> Running tests...$(NO_COLOR)"
|
||||||
@go test $(PKGS)
|
@go test $(PKGS)
|
||||||
|
|
||||||
|
## test-coverage: run tests with coverage
|
||||||
|
test-coverage:
|
||||||
|
@echo $(ECHOFLAGS) "$(OK_COLOR)==> Running tests with coverage...$(NO_COLOR)"
|
||||||
|
@go test -race -covermode=atomic -coverprofile coverage.out ./...
|
||||||
|
|
||||||
|
## test-show-coverage: show coverage
|
||||||
|
test-show-coverage: test-coverage
|
||||||
|
@echo $(ECHOFLAGS) "$(OK_COLOR)==> Show test coverage...$(NO_COLOR)"
|
||||||
|
@go tool cover -html coverage.out
|
||||||
|
|
||||||
## run: run git-sv
|
## run: run git-sv
|
||||||
run:
|
run:
|
||||||
@echo $(ECHOFLAGS) "$(OK_COLOR)==> Running bin/$(BUILDOS)_$(BUILDARCH)/$(BIN)...$(NO_COLOR)"
|
@echo $(ECHOFLAGS) "$(OK_COLOR)==> Running bin/$(BUILDOS)_$(BUILDARCH)/$(BIN)...$(NO_COLOR)"
|
||||||
|
|
Loading…
Reference in a new issue