Skip to content

Commit

Permalink
chore: rename GO_COVERAGE_{OUTPUT,PROFILE}
Browse files Browse the repository at this point in the history
Signed-off-by: black-desk <me@black-desk.cn>
  • Loading branch information
black-desk committed Oct 18, 2024
1 parent 16f53c1 commit c9e852f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/cgtproxy-debug
/test/coverage.html
/test/coverprofile
/coverage.txt
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 "\
Expand All @@ -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)"
Expand Down

0 comments on commit c9e852f

Please sign in to comment.