aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 90d9f55..092b2ca 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,22 @@
## SPDX-FileCopyrightText: 2018 M. Shulhan <ms@kilabit.info>
## SPDX-License-Identifier: GPL-3.0-or-later
-.PHONY: all build test lint install serve-doc
+.PHONY: all build lint install serve-doc
all: install
build:
go build -v ./cmd/haminer
+## Run all tests and generate coverage as HTML.
+
+COVER_OUT:=cover.out
+COVER_HTML:=cover.html
+
+.PHONY: test
test:
- CGO_ENABLED=1 go test -race ./...
+ CGO_ENABLED=1 go test -failfast -timeout=1m -race \
+ -coverprofile=$(COVER_OUT) ./...
+ go tool cover -html=$(COVER_OUT) -o $(COVER_HTML)
lint:
-fieldalignment ./...