@@ -204,24 +204,30 @@ sync-docs:
204
204
test : test-unit
205
205
test-all : test-unit test-ledger-mock test-race test-cover
206
206
207
- test-ledger-mock :
208
- @go test -mod=readonly ` go list github.com/cosmos/cosmos-sdk/crypto` -tags=' cgo ledger test_ledger_mock'
209
-
210
- test-ledger : test-ledger-mock
211
- @go test -mod=readonly -v ` go list github.com/cosmos/cosmos-sdk/crypto` -tags=' cgo ledger'
212
-
213
- test-unit : test-unit-proto
214
-
215
- test-unit-proto :
216
- @VERSION=$(VERSION ) go test -mod=readonly ./... -tags=' ledger test_ledger_mock'
217
-
218
- test-unit-amino :
219
- @VERSION=$(VERSION ) go test -mod=readonly ./... -tags=' ledger test_ledger_mock test_amino'
220
-
221
- test-race :
222
- @VERSION=$(VERSION ) go test -mod=readonly -race $(PACKAGES_NOSIMULATION )
207
+ TEST_PACKAGES =./...
208
+ TEST_TARGETS := test-unit test-unit-amino test-unit-proto test-ledger-mock test-race test-ledger test-race
209
+
210
+ # Test runs-specific rules. To add a new test target, just add
211
+ # a new rule, customise ARGS or TEST_PACKAGES ad libitum, and
212
+ # append the new rule to the TEST_TARGETS list.
213
+
214
+ test-unit : ARGS=-tags='cgo ledger test_ledger_mock'
215
+ test-unit-amino : ARGS=-tags='ledger test_ledger_mock test_amino'
216
+ test-ledger : ARGS=-tags='cgo ledger'
217
+ test-ledger-mock : ARGS=-tags='ledger test_ledger_mock'
218
+ test-race : ARGS=-race -tags='cgo ledger test_ledger_mock'
219
+ test-race : TEST_PACKAGES=$(PACKAGES_NOSIMULATION )
220
+
221
+ $(TEST_TARGETS ) : run-tests
222
+
223
+ run-tests :
224
+ ifneq (,$(shell which tparse 2>/dev/null) )
225
+ go test -mod=readonly -json $(ARGS) $(TEST_PACKAGES) | tparse
226
+ else
227
+ go test -mod=readonly $(ARGS) $(TEST_PACKAGES)
228
+ endif
223
229
224
- .PHONY : test test-all test-ledger-mock test-ledger test-unit test-race
230
+ .PHONY : run-tests test test-all $( TEST_TARGETS )
225
231
226
232
test-sim-nondeterminism :
227
233
@echo " Running non-determinism test..."
0 commit comments