From 25b5e1e0997013ae9a6f83e1991e419a7af105ee Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 21 May 2021 14:47:05 +0930 Subject: [PATCH] update-mocks: make sure we cover all test programs. Signed-off-by: Rusty Russell --- Makefile | 5 ++++- bitcoin/test/Makefile | 1 - channeld/test/Makefile | 2 -- cli/test/Makefile | 2 -- common/test/Makefile | 2 -- connectd/test/Makefile | 2 -- gossipd/test/Makefile | 2 -- lightningd/test/Makefile | 2 -- onchaind/test/Makefile | 2 -- plugins/test/Makefile | 2 -- tools/test/Makefile | 4 ---- wallet/test/Makefile | 4 ---- wire/test/Makefile | 2 -- 13 files changed, 4 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 2575184e8..5ca5d6cbd 100644 --- a/Makefile +++ b/Makefile @@ -619,7 +619,10 @@ clean: obsclean find . -name '*gcno' -delete find . -name '*.nccout' -delete -update-mocks: $(ALL_GEN_HEADERS) +update-mocks: $(ALL_TEST_PROGRAMS:%=update-mocks/%.c) + +$(ALL_TEST_PROGRAMS:%=update-mocks/%.c): $(ALL_GEN_HEADERS) $(EXTERNAL_LIBS) $(CCAN_OBJS) ccan/ccan/cdump/tools/cdump-enumstr config.vars + update-mocks/%: % @MAKE=$(MAKE) tools/update-mocks.sh "$*" $(SUPPRESS_OUTPUT) diff --git a/bitcoin/test/Makefile b/bitcoin/test/Makefile index f3c541641..411019d35 100644 --- a/bitcoin/test/Makefile +++ b/bitcoin/test/Makefile @@ -12,6 +12,5 @@ ALL_C_SOURCES += $(BITCOIN_TEST_PROGRAMS:=.c) # This needs to know what level of optimization we're using. bitcoin/test/run-secret_eq_consttime.o: CFLAGS += -DCOPTFLAGS="\"${COPTFLAGS}\"" -update-mocks: $(BITCOIN_TEST_SRC:%=update-mocks/%) check-units: $(BITCOIN_TEST_PROGRAMS:%=unittest/%) diff --git a/channeld/test/Makefile b/channeld/test/Makefile index 95d95c1f2..7847f0222 100644 --- a/channeld/test/Makefile +++ b/channeld/test/Makefile @@ -22,8 +22,6 @@ CHANNELD_TEST_COMMON_OBJS := \ common/type_to_string.o \ common/utils.o -update-mocks: $(CHANNELD_TEST_SRC:%=update-mocks/%) - $(CHANNELD_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CHANNELD_TEST_COMMON_OBJS) $(CHANNELD_TEST_OBJS): $(CHANNELD_HEADERS) $(CHANNELD_SRC) diff --git a/cli/test/Makefile b/cli/test/Makefile index 82c451b1f..3093fbdbb 100644 --- a/cli/test/Makefile +++ b/cli/test/Makefile @@ -19,8 +19,6 @@ CLI_TEST_COMMON_OBJS := \ common/type_to_string.o \ common/permute_tx.o -update-mocks: $(CLI_TEST_SRC:%=update-mocks/%) - $(CLI_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CLI_TEST_COMMON_OBJS) $(CLI_TEST_OBJS): $(LIGHTNING_CLI_HEADERS) $(LIGHTNING_CLI_SRC) diff --git a/common/test/Makefile b/common/test/Makefile index 507e4e5fc..5c5274cc4 100644 --- a/common/test/Makefile +++ b/common/test/Makefile @@ -33,6 +33,4 @@ common/test/run-json: \ wire/onion$(EXP)_wiregen.o \ wire/towire.o -update-mocks: $(COMMON_TEST_SRC:%=update-mocks/%) - check-units: $(COMMON_TEST_PROGRAMS:%=unittest/%) diff --git a/connectd/test/Makefile b/connectd/test/Makefile index 06b0faa34..fe92b2376 100644 --- a/connectd/test/Makefile +++ b/connectd/test/Makefile @@ -14,8 +14,6 @@ CONNECTD_TEST_COMMON_OBJS := \ ALL_C_SOURCES += $(CONNECTD_TEST_SRC) ALL_TEST_PROGRAMS += $(CONNECTD_TEST_PROGRAMS) -update-mocks: $(CONNECTD_TEST_SRC:%=update-mocks/%) - $(CONNECTD_TEST_PROGRAMS): $(CONNECTD_TEST_COMMON_OBJS) $(BITCOIN_OBJS) # Test objects depend on ../ src and headers. diff --git a/gossipd/test/Makefile b/gossipd/test/Makefile index c94652515..4607384de 100644 --- a/gossipd/test/Makefile +++ b/gossipd/test/Makefile @@ -26,8 +26,6 @@ GOSSIPD_TEST_COMMON_OBJS := \ ALL_C_SOURCES += $(GOSSIPD_TEST_SRC) ALL_TEST_PROGRAMS += $(GOSSIPD_TEST_PROGRAMS) -update-mocks: $(GOSSIPD_TEST_SRC:%=update-mocks/%) - $(GOSSIPD_TEST_PROGRAMS): $(GOSSIPD_TEST_COMMON_OBJS) $(BITCOIN_OBJS) # Test objects depend on ../ src and headers. diff --git a/lightningd/test/Makefile b/lightningd/test/Makefile index da39178dd..d19d8d277 100644 --- a/lightningd/test/Makefile +++ b/lightningd/test/Makefile @@ -25,8 +25,6 @@ LIGHTNINGD_TEST_COMMON_OBJS := \ common/type_to_string.o \ common/permute_tx.o -update-mocks: $(LIGHTNINGD_TEST_SRC:%=update-mocks/%) - $(LIGHTNINGD_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIGHTNINGD_TEST_COMMON_OBJS) $(LIGHTNINGD_TEST_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_SRC) $(LIGHTNINGD_SRC_NOHDR) diff --git a/onchaind/test/Makefile b/onchaind/test/Makefile index d1a67783a..d52a04777 100644 --- a/onchaind/test/Makefile +++ b/onchaind/test/Makefile @@ -17,8 +17,6 @@ ONCHAIND_TEST_COMMON_OBJS := \ common/type_to_string.o \ common/utils.o -update-mocks: $(ONCHAIND_TEST_SRC:%=update-mocks/%) - $(ONCHAIND_TEST_PROGRAMS): $(ONCHAIND_TEST_COMMON_OBJS) $(BITCOIN_OBJS) # This needs many more objs: diff --git a/plugins/test/Makefile b/plugins/test/Makefile index 2c4b5c121..694ea7f7a 100644 --- a/plugins/test/Makefile +++ b/plugins/test/Makefile @@ -14,8 +14,6 @@ PLUGIN_TEST_COMMON_OBJS := \ common/type_to_string.o \ common/utils.o -update-mocks: $(PLUGIN_TEST_SRC:%=update-mocks/%) - $(PLUGIN_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(PLUGIN_TEST_COMMON_OBJS) $(PLUGIN_TEST_OBJS): $(PLUGIN_FUNDER_HEADER) $(PLUGIN_FUNDER_SRC) diff --git a/tools/test/Makefile b/tools/test/Makefile index 50b57c942..38f7f1856 100644 --- a/tools/test/Makefile +++ b/tools/test/Makefile @@ -58,10 +58,6 @@ ALL_TEST_PROGRAMS += $(TOOL_TEST_PROGRAMS) check-tools: $(TOOL_TEST_PROGRAMS:%=unittest/%) endif # HAVE_PYTHON3_MAKO -update-mocks: tools-update-mocks - -tools-update-mocks: $(TOOL_TEST_SRC:%=update-mocks/%) - clean: tools-test-clean tools-test-clean: diff --git a/wallet/test/Makefile b/wallet/test/Makefile index 79fd890e6..8c60d6c8e 100644 --- a/wallet/test/Makefile +++ b/wallet/test/Makefile @@ -30,8 +30,4 @@ WALLET_TEST_COMMON_OBJS := \ $(WALLET_TEST_PROGRAMS): $(BITCOIN_OBJS) $(WALLET_TEST_COMMON_OBJS) $(WALLET_TEST_OBJS): $(WALLET_HDRS) $(WALLET_SRC) -wallet/tests: $(WALLET_TEST_PROGRAMS:%=unittest/%) - -update-mocks: $(WALLET_TEST_SRC:%=update-mocks/%) - check-units: $(WALLET_TEST_PROGRAMS:%=unittest/%) diff --git a/wire/test/Makefile b/wire/test/Makefile index 7bbf3349d..1723fb378 100644 --- a/wire/test/Makefile +++ b/wire/test/Makefile @@ -14,8 +14,6 @@ WIRE_TEST_COMMON_OBJS := \ common/setup.o \ common/utils.o -update-mocks: $(WIRE_TEST_SRC:%=update-mocks/%) - # run-tlvstream.c needs to reach into bitcoin/pubkey for SUPERVERBOSE $(WIRE_TEST_PROGRAMS): $(WIRE_TEST_COMMON_OBJS) $(filter-out bitcoin/pubkey.o,$(BITCOIN_OBJS))