Skip to content

Commit 72893a2

Browse files
committed
make+tools: remove GOACC, use Go 1.20 builtin functionality
Starting with Go 1.20 the -coverprofile flag does the same that GOACC did before.
1 parent 6238e65 commit 72893a2

File tree

5 files changed

+4
-107
lines changed

5 files changed

+4
-107
lines changed

Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ PKG := github.com/lightninglabs/taproot-assets
22

33
BTCD_PKG := github.com/btcsuite/btcd
44
LND_PKG := github.com/lightningnetwork/lnd
5-
GOACC_PKG := github.com/ory/go-acc
65
GOIMPORTS_PKG := github.com/rinchsan/gosimports/cmd/gosimports
76
TOOLS_DIR := tools
87

98
GO_BIN := ${GOPATH}/bin
10-
GOACC_BIN := $(GO_BIN)/go-acc
119
GOIMPORTS_BIN := $(GO_BIN)/gosimports
1210
MIGRATE_BIN := $(GO_BIN)/migrate
1311

@@ -75,10 +73,6 @@ all: scratch check install
7573
# DEPENDENCIES
7674
# ============
7775

78-
$(GOACC_BIN):
79-
@$(call print, "Installing go-acc.")
80-
cd $(TOOLS_DIR); go install -trimpath $(GOACC_PKG)
81-
8276
$(GOIMPORTS_BIN):
8377
@$(call print, "Installing goimports.")
8478
cd $(TOOLS_DIR); go install -trimpath $(GOIMPORTS_PKG)
@@ -188,9 +182,9 @@ unit-trace:
188182
@$(call print, "Running unit tests in trace mode (enabling package loggers on level trace).")
189183
$(UNIT_TRACE)
190184

191-
unit-cover: $(GOACC_BIN)
185+
unit-cover:
192186
@$(call print, "Running unit coverage tests.")
193-
$(GOACC); $(COVER_HTML)
187+
$(UNIT_COVER)
194188

195189
unit-race:
196190
@$(call print, "Running unit race tests.")

make/testing_flags.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ UNIT_TARGETED ?= no
104104
# targeted case. Otherwise, default to running all tests.
105105
ifeq ($(UNIT_TARGETED), yes)
106106
UNIT := $(GOTEST) -tags="$(DEV_TAGS) $(LOG_TAGS)" $(TEST_FLAGS) $(UNITPKG)
107+
UNIT_COVER := $(GOTEST) -coverprofile=coverage.txt -tags="$(DEV_TAGS) $(LOG_TAGS)" $(TEST_FLAGS) $(UNITPKG)
107108
UNIT_DEBUG := $(GOTEST) -v -tags="$(DEV_TAGS) $(LOG_TAGS)" $(TEST_FLAGS) $(UNITPKG)
108109
UNIT_TRACE := $(GOTEST) -v -tags="$(DEV_TAGS) stdout trace" $(TEST_FLAGS) $(UNITPKG)
109110
UNIT_RACE := $(GOTEST) -tags="$(DEV_TAGS) $(LOG_TAGS) lowscrypt" $(TEST_FLAGS) -race $(UNITPKG)
110111
endif
111112

112113
ifeq ($(UNIT_TARGETED), no)
113114
UNIT := $(GOLIST) | $(XARGS) env $(GOTEST) -tags="$(DEV_TAGS) $(LOG_TAGS)" $(TEST_FLAGS)
115+
UNIT_COVER := $(GOTEST) -coverprofile=coverage.txt -tags="$(DEV_TAGS) $(LOG_TAGS)" $(TEST_FLAGS) ./...
114116
UNIT_DEBUG := $(GOLIST) | $(XARGS) env $(GOTEST) -v -tags="$(DEV_TAGS) $(LOG_TAGS)" $(TEST_FLAGS)
115117
UNIT_TRACE := $(GOLIST) | $(XARGS) env $(GOTEST) -v -tags="$(DEV_TAGS) stdout trace" $(TEST_FLAGS)
116118
UNIT_RACE := $(UNIT) -race

tools/go.mod

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ require (
66
github.com/btcsuite/btcd v0.24.2
77
github.com/dvyukov/go-fuzz v0.0.0-20210602112143-b1f3d6f4ef4e
88
github.com/golangci/golangci-lint v1.57.1
9-
github.com/ory/go-acc v0.2.6
109
github.com/rinchsan/gosimports v0.1.5
1110
)
1211

@@ -47,7 +46,6 @@ require (
4746
github.com/butuzov/mirror v1.1.0 // indirect
4847
github.com/catenacyber/perfsprint v0.7.1 // indirect
4948
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect
50-
github.com/cespare/xxhash v1.1.0 // indirect
5149
github.com/cespare/xxhash/v2 v2.1.2 // indirect
5250
github.com/charithe/durationcheck v0.0.10 // indirect
5351
github.com/chavacava/garif v0.1.0 // indirect
@@ -59,7 +57,6 @@ require (
5957
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
6058
github.com/decred/dcrd/lru v1.0.0 // indirect
6159
github.com/denis-tingaikin/go-header v0.5.0 // indirect
62-
github.com/dgraph-io/ristretto v0.0.2 // indirect
6360
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
6461
github.com/ettle/strcase v0.2.0 // indirect
6562
github.com/fatih/color v1.16.0 // indirect
@@ -89,7 +86,6 @@ require (
8986
github.com/golangci/revgrep v0.5.2 // indirect
9087
github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect
9188
github.com/google/go-cmp v0.6.0 // indirect
92-
github.com/google/uuid v1.6.0 // indirect
9389
github.com/gordonklaus/ineffassign v0.1.0 // indirect
9490
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
9591
github.com/gostaticanalysis/comment v1.4.2 // indirect
@@ -136,8 +132,6 @@ require (
136132
github.com/nishanths/predeclared v0.2.2 // indirect
137133
github.com/nunnatsa/ginkgolinter v0.16.1 // indirect
138134
github.com/olekukonko/tablewriter v0.0.5 // indirect
139-
github.com/ory/viper v1.7.5 // indirect
140-
github.com/pborman/uuid v1.2.0 // indirect
141135
github.com/pelletier/go-toml v1.9.5 // indirect
142136
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
143137
github.com/pmezard/go-difflib v1.0.0 // indirect

0 commit comments

Comments
 (0)