From c9e852f9161cfa7d8630bbc9a302a33263923811 Mon Sep 17 00:00:00 2001 From: black-desk Date: Fri, 18 Oct 2024 17:54:37 +0800 Subject: [PATCH] chore: rename GO_COVERAGE_{OUTPUT,PROFILE} Signed-off-by: black-desk --- .gitignore | 1 + Makefile | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 45895e4..242c753 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /cgtproxy-debug /test/coverage.html /test/coverprofile +/coverage.txt diff --git a/Makefile b/Makefile index 7b8c28a..8770cec 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,7 @@ UNSHARE ?= unshare -U -C -m -n --map-user=0 -- CGROUPFS ?= /tmp/io.github.black-desk.cgtproxy-test/cgroupfs -GO_COVERAGE_OUTPUT ?= /tmp/io.github.black-desk.cgtproxy-test/coverage.out -GO_COVERAGE_REPORT ?= /tmp/io.github.black-desk.cgtproxy-test/coverage.txt +GO_COVERAGE_PROFILE ?= coverage.txt .PHONY: test test: @@ -85,7 +84,7 @@ test: -tags="$(_GO_TAGS),$(GO_TAGS)" \ -run=__SHOULD_NEVER_MATCH__ - mkdir -p -- $(shell dirname -- "$(GO_COVERAGE_OUTPUT)") + mkdir -p -- $(shell dirname -- "$(GO_COVERAGE_PROFILE)") mkdir -p -- $(CGROUPFS) $(SYSTEMD_RUN) $(UNSHARE) $(SHELL) -c "\ @@ -95,15 +94,11 @@ test: export CGTPROXY_TEST_NFTMAN=1 && \ export PATH=$(PATH) && \ $(GO) test ./... -v --ginkgo.vv \ - -coverprofile=\"$(GO_COVERAGE_OUTPUT)\" \ + -coverprofile=\"$(GO_COVERAGE_PROFILE)\" \ -ldflags \"$(_GO_LDFLAGS) $(GO_LDFLAGS)\" \ -tags=\"$(_GO_TAGS),$(GO_TAGS)\" \ " -.PHONY: test-coverage-report -test-coverage-report: - go tool cover -func=$(GO_COVERAGE_OUTPUT) -o=$(GO_COVERAGE_REPORT) - .PHONY: install-bin install-bin: $(INSTALL) -d "$(DESTDIR)$(bindir)"