From d5117b53fa32e546a0d5c8bb15ec516939542cd8 Mon Sep 17 00:00:00 2001 From: HotPotatoC Date: Fri, 24 Dec 2021 01:20:36 +0700 Subject: [PATCH] build: added coverage script --- .gitignore | 1 + Makefile | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index a3c7b50..52e1f93 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ *.test *.out *.kvsdb +coverage* .vscode \ No newline at end of file diff --git a/Makefile b/Makefile index ab0a987..271816a 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,11 @@ test: ## Run the tests bench: ## Run the benchmarks go test -bench=. -benchmem ./... +.PHONY: coverage +coverage: ## Generate coverage report + go test -coverprofile=coverage.out ./... + go tool cover -html=coverage.out -o coverage.html + .PHONY: install install: ## Install the binary go install -ldflags "${LDFLAGS}" ./...