aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-13 02:30:36 +0700
committerShulhan <ms@kilabit.info>2026-01-13 02:30:36 +0700
commit3bc8f7ea570c726d88f4e0d31910b9eec999ce46 (patch)
treeacb2b979de889cd304d24e595f212fddc14a7aab
parente1a3b3b44a9daeee1aeac6fdea869a4e8458ec4a (diff)
downloadspdxconv-3bc8f7ea570c726d88f4e0d31910b9eec999ce46.tar.xz
Makefile: use the old test coverage using CGO
Using "test.gocoverdir" require creating the cover directory first, and when we changes the file name of go files there will be an error.
-rw-r--r--.gitignore1
-rw-r--r--Makefile6
2 files changed, 2 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index cebcb10..d00bf10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: 2026 M. Shulhan <ms@kilabit.info>
-_coverage/
_doc/index.html
cover.html
cover.out
diff --git a/Makefile b/Makefile
index 5a7a4e8..03ae6b3 100644
--- a/Makefile
+++ b/Makefile
@@ -11,10 +11,8 @@ lint:
.PHONY: test
test:
- mkdir -p _coverage
- go test -cover ./... -test.gocoverdir=_coverage
- go tool covdata textfmt -i=_coverage -o cover.txt
- go tool cover -html=cover.txt -o cover.html
+ CGO_ENABLED=1 go test -race -coverprofile=cover.out ./...
+ go tool cover -html=cover.out -o cover.html
.PHONY: pre-push
pre-push: