Small improvement to coverage target

This commit is contained in:
Marius Orcsik 2019-06-11 13:49:58 +02:00
parent e6b9cf2088
commit 294d56dba4
No known key found for this signature in database
GPG key ID: 889CE8E4FB2D877A

View file

@ -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