diff options
| author | Shulhan <ms@kilabit.info> | 2023-01-20 17:43:02 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-01-20 18:33:08 +0700 |
| commit | 60ef28a1de5f20ae13c4a5a01cb5aa6ee92d31b0 (patch) | |
| tree | 59cb17367dcbda2e1deb06de16eaaeab3ea1845c | |
| parent | 5d2c32ffa88c08d94f752e727ef7b7c8b409bcc0 (diff) | |
| download | duitku-60ef28a1de5f20ae13c4a5a01cb5aa6ee92d31b0.tar.xz | |
make: print total test coverage and generate coverage files
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile | 7 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,5 @@ ## SPDX-FileCopyrightText: 2022 M. Shulhan <ms@kilabit.info> ## SPDX-License-Identifier: GPL-3.0-or-later *.json +cover.html +cover.out @@ -1,10 +1,15 @@ ## SPDX-FileCopyrightText: 2022 M. Shulhan <ms@kilabit.info> ## SPDX-License-Identifier: GPL-3.0-or-later +COVER_OUT=cover.out +COVER_HTML=cover.html + .PHONY: all test all: test test: - CGO_ENABLED=1 go test -race ./... + CGO_ENABLED=1 go test -race -coverprofile=$(COVER_OUT) ./... + go tool cover -html=$(COVER_OUT) -o $(COVER_HTML) + go tool cover -func=$(COVER_OUT) | tail -n1 fieldalignment ./... |
