From 381f439a8e4f5a5b94abfc298711624875b9081a Mon Sep 17 00:00:00 2001 From: Gijs van Dam Date: Mon, 29 Apr 2024 14:34:11 +0200 Subject: [PATCH] makefile: targets for itest w/ race detection This commits adds three targets for race detection: - `build-itest-race` builds itest btcd and itest lnd, but only the latter with the `race` flag set. - `itest-race-only` runs itests with the `race` flag set. - `itest-race` runs `build-itest-race` and `itest-race-only` consecutively. --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 122abc847..0c13bd563 100644 --- a/Makefile +++ b/Makefile @@ -98,6 +98,13 @@ build-itest: @$(call print, "Building itest lnd.") CGO_ENABLED=0 $(GOBUILD) -mod=mod -tags="$(ITEST_TAGS)" -o itest/lnd-itest $(DEV_LDFLAGS) $(LND_PKG)/cmd/lnd +build-itest-race: + @$(call print, "Building itest btcd.") + CGO_ENABLED=0 $(GOBUILD) -tags="integration" -o itest/btcd-itest $(BTCD_PKG) + + @$(call print, "Building itest lnd.") + CGO_ENABLED=1 $(GOBUILD) -race -mod=mod -tags="$(ITEST_TAGS)" -o itest/lnd-itest $(DEV_LDFLAGS) $(LND_PKG)/cmd/lnd + build-loadtest: CGO_ENABLED=0 $(GOTEST) -c -tags="$(LOADTEST_TAGS)" -o loadtest $(PKG)/itest/loadtest @@ -184,6 +191,8 @@ unit-race: itest: build-itest itest-only +itest-race: build-itest-race itest-race-only + itest-trace: build-itest itest-only-trace itest-only: aperture-dir @@ -191,6 +200,11 @@ itest-only: aperture-dir rm -rf itest/regtest; date $(GOTEST) ./itest -v -tags="$(ITEST_TAGS)" $(TEST_FLAGS) $(ITEST_FLAGS) -btcdexec=./btcd-itest -logdir=regtest +itest-race-only: aperture-dir + @$(call print, "Running integration tests with ${backend} backend.") + rm -rf itest/regtest; date + $(GOTEST) -race ./itest -v -tags="$(ITEST_TAGS)" $(TEST_FLAGS) $(ITEST_FLAGS) -btcdexec=./btcd-itest -logdir=regtest + itest-only-trace: aperture-dir @$(call print, "Running integration tests with ${backend} backend.") rm -rf itest/regtest; date