build: add itest-race build target to catch data races with itests
This commit adds itest-race build target that can be used with individual itests to detect and catch uncovered data races.
This commit is contained in:
parent
fb17bf2bb5
commit
798bf05838
10
Makefile
10
Makefile
@ -143,6 +143,14 @@ build-itest:
|
||||
@$(call print, "Building itest binary for ${backend} backend.")
|
||||
CGO_ENABLED=0 $(GOTEST) -v ./lntest/itest -tags="$(DEV_TAGS) $(RPC_TAGS) rpctest $(backend)" -c -o lntest/itest/itest.test$(EXEC_SUFFIX)
|
||||
|
||||
build-itest-race:
|
||||
@$(call print, "Building itest btcd and lnd with race detector.")
|
||||
CGO_ENABLED=0 $(GOBUILD) -tags="rpctest" -o lntest/itest/btcd-itest$(EXEC_SUFFIX) $(ITEST_LDFLAGS) $(BTCD_PKG)
|
||||
CGO_ENABLED=1 $(GOBUILD) -race -tags="$(ITEST_TAGS)" -o lntest/itest/lnd-itest$(EXEC_SUFFIX) $(ITEST_LDFLAGS) $(PKG)/cmd/lnd
|
||||
|
||||
@$(call print, "Building itest binary for ${backend} backend.")
|
||||
CGO_ENABLED=0 $(GOTEST) -v ./lntest/itest -tags="$(DEV_TAGS) $(RPC_TAGS) rpctest $(backend)" -c -o lntest/itest/itest.test$(EXEC_SUFFIX)
|
||||
|
||||
install:
|
||||
@$(call print, "Installing lnd and lncli.")
|
||||
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/lnd
|
||||
@ -187,6 +195,8 @@ itest-only:
|
||||
|
||||
itest: build-itest itest-only
|
||||
|
||||
itest-race: build-itest-race itest-only
|
||||
|
||||
itest-parallel: build-itest
|
||||
@$(call print, "Running tests")
|
||||
rm -rf lntest/itest/*.log lntest/itest/.logs-*; date
|
||||
|
Loading…
Reference in New Issue
Block a user