Small improvement to coverage target
This commit is contained in:
parent
e6b9cf2088
commit
294d56dba4
9
Makefile
9
Makefile
|
@ -1,14 +1,15 @@
|
|||
TEST := go test
|
||||
TEST_FLAGS ?= -v
|
||||
TEST_TARGET ?= ./...
|
||||
GO111MODULE=on
|
||||
GO111MODULE = on
|
||||
PROJECT_NAME := $(shell basename $(PWD))
|
||||
|
||||
test:
|
||||
$(TEST) $(TEST_FLAGS) $(TEST_TARGET)
|
||||
|
||||
coverprofile: TEST_TARGET := .
|
||||
coverprofile: TEST_FLAGS += -covermode=count -coverprofile=$(TEST_TARGET).coverprofile
|
||||
coverprofile: test
|
||||
coverage: TEST_TARGET := .
|
||||
coverage: TEST_FLAGS += -covermode=count -coverprofile $(PROJECT_NAME).coverprofile
|
||||
coverage: test
|
||||
|
||||
clean:
|
||||
$(RM) -v *.coverprofile
|
||||
|
|
Reference in a new issue