-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eray Ates <eray.ates@worldline.com>
- Loading branch information
Showing
4 changed files
with
419 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.