-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (15 loc) · 769 Bytes
/
Makefile
File metadata and controls
22 lines (15 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.DEFAULT_GOAL := help
.PHONY: test coverage html html-gen html-wsl help
test: ## Run unit tests
@go test -timeout 30s -v -race ./...
coverage: ## Run unit tests with coverage
@go test -timeout 30s -v -race -cover -coverpkg=./... -coverprofile=coverage.out -covermode=atomic ./...
@go tool cover -func=coverage.out
html: ## Show html coverage result
@go tool cover -html=./coverage.out
html-gen: ## Export html coverage result
@go tool cover -html=./coverage.out -o ./coverage.html
html-wsl: html-gen ## Open html coverage result in wsl
@explorer.exe `wslpath -w ./coverage.html` || true
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'