-
Notifications
You must be signed in to change notification settings - Fork 3
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 <[email protected]>
- Loading branch information
Showing
4 changed files
with
11 additions
and
6 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 |
---|---|---|
@@ -1,27 +1,32 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: example test coverage help html html-gen html-wsl | ||
|
||
.PHONY: test-data | ||
test-data: export DATA ?= ColorGroup | ||
test-data: ## Run data test | ||
@go test -timeout 30s -v -run ^Test_Data$ | ||
|
||
.PHONY: test | ||
test: export DATA ?= ColorGroup | ||
test: ## Run unit tests | ||
@go test -race -cover ./... | ||
|
||
.PHONY: coverage | ||
coverage: ## Run unit tests with coverage | ||
@go test -v -race -cover -coverpkg=./... -coverprofile=coverage.out -covermode=atomic ./... | ||
@go tool cover -func=coverage.out | ||
|
||
.PHONY: html | ||
html: ## Show html coverage result | ||
@go tool cover -html=./coverage.out | ||
|
||
.PHONY: html-gen | ||
html-gen: ## Export html coverage result | ||
@go tool cover -html=./coverage.out -o ./coverage.html | ||
|
||
.PHONY: html-wsl | ||
html-wsl: html-gen ## Open html coverage result in wsl | ||
@explorer.exe `wslpath -w ./coverage.html` || true | ||
|
||
.PHONY: help | ||
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
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