...
1# Project packages.
2PACKAGES=$(shell go list ./...)
3
4# Flags passed to `go test`
5BUILDFLAGS ?=
6TESTFLAGS ?=
7
8.PHONY: all build test coverage
9.DEFAULT: all
10
11all: build
12
13build: ## no binaries to build, so just check compilation suceeds
14 go build ${BUILDFLAGS} ./...
15
16test: ## run tests
17 go test ${TESTFLAGS} ./...
18
19coverage: ## generate coverprofiles from the unit tests
20 rm -f coverage.txt
21 go test ${TESTFLAGS} -cover -coverprofile=cover.out ./...
22
23.PHONY: help
24help:
25 @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_\/%-]+:.*?##/ { printf " \033[36m%-27s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
View as plain text