aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-02-04 16:11:14 +0700
committerShulhan <ms@kilabit.info>2024-02-04 16:11:21 +0700
commit4fefec82bb1ee34350cfc4dd61140c2f1ce8afb0 (patch)
treea3a5c645b406792b61d3931ec17cddf0f2556e79
parent6535043e55fa510bde5b66085d4b88326004faee (diff)
downloadgorankusu-4fefec82bb1ee34350cfc4dd61140c2f1ce8afb0.tar.xz
make: generate test coverage
-rw-r--r--.gitignore2
-rw-r--r--Makefile6
2 files changed, 7 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index ef692d1..59f964f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
/_www/wui.local
/example/testdata
/trunks
+cover.html
+cover.out
diff --git a/Makefile b/Makefile
index 0875d72..8f945f5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
## SPDX-FileCopyrightText: 2021 M. Shulhan <ms@kilabit.info>
## SPDX-License-Identifier: GPL-3.0-or-later
+COVER_OUT:=cover.out
+COVER_HTML:=cover.html
+
.PHONY: all
all: lint test
go run ./internal/cmd/trunks build
@@ -17,7 +20,8 @@ lint-www:
.PHONY: test
test:
- CGO_ENABLED=1 go test -v -race ./...
+ CGO_ENABLED=1 go test -failfast -timeout=1m -race -coverprofile=$(COVER_OUT) ./...
+ go tool cover -html=$(COVER_OUT) -o $(COVER_HTML)
.PHONY: dev
dev: