diff --git a/Makefile b/Makefile index 19e20bf..248f7c5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help default test test-run test-teardown generate lint fmt +.PHONY: help default test test-run generate lint fmt GO=go LDFLAGS?=-s -w @@ -9,7 +9,7 @@ default: lint generate: install-tools $(GO) generate ./... -test: install-tools test-run test-teardown +test: install-tools test-run test-run: ## Run all unit tests ifeq ($(filter 1,$(debug) $(RUNNER_DEBUG)),) @@ -33,23 +33,6 @@ else $(TEST_CMD) -count=1 $(TEST_OPTIONS) ./... && touch $(TESTFILE) || true endif -test-teardown: - @if [ -f "$(TESTFILE)" ]; then \ - echo "Tests passed, tearing down..." ;\ - rm -f $(TESTFILE) ;\ - echo "mode: atomic" > coverage.txt ;\ - find . -name "profile.out" | while read file; do grep -v 'mode: atomic' $${file} >> coverage.txt; rm -f $${file}; done ;\ - else \ - rm -f coverage.txt coverage.html ; find . -name "profile.out" | xargs rm -f ;\ - echo "Tests failed :-(" ;\ - exit 1 ;\ - fi - -coverage: - go tool cover -html=coverage.txt -o coverage.html - -test-with-coverage: test coverage - help: ## Show the available commands @grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'