mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
test: fix dependencies.
Test objects must be added to $(ALL_OBJS) so they correctly depend on CCAN headers etc. Also, each test in a subdir must depend on headers and src in the parent directory, as it will often #include them directly. Reported-by: Christian Decker Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
37b4ab306e
commit
40315bfb91
@ -5,6 +5,7 @@ CHANNELD_TEST_OBJS := $(CHANNELD_TEST_SRC:.c=.o)
|
||||
CHANNELD_TEST_PROGRAMS := $(CHANNELD_TEST_OBJS:.o=)
|
||||
|
||||
ALL_TEST_PROGRAMS += $(CHANNELD_TEST_PROGRAMS)
|
||||
ALL_OBJS += $(CHANNELD_TEST_OBJS)
|
||||
|
||||
CHANNELD_TEST_COMMON_OBJS := \
|
||||
common/daemon_conn.o \
|
||||
@ -19,6 +20,6 @@ update-mocks: $(CHANNELD_TEST_SRC:%=update-mocks/%)
|
||||
|
||||
$(CHANNELD_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIBBASE58_OBJS) $(CHANNELD_TEST_COMMON_OBJS)
|
||||
|
||||
$(CHANNELD_TEST_OBJS): $(CHANNELD_HEADERS) $(CHANNELD_SRC)
|
||||
$(CHANNELD_TEST_OBJS): $(LIGHTNING_CHANNELD_HEADERS) $(LIGHTNING_CHANNELD_SRC)
|
||||
|
||||
check: $(CHANNELD_TEST_PROGRAMS:%=unittest/%)
|
||||
|
@ -15,8 +15,8 @@ update-mocks: $(GOSSIPD_TEST_SRC:%=update-mocks/%)
|
||||
|
||||
$(GOSSIPD_TEST_PROGRAMS): $(GOSSIPD_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
|
||||
|
||||
# Test objects require source to be generated, since they include ..
|
||||
$(GOSSIPD_TEST_OBJS): $(GOSSIPD_GEN_SRC) $(LIGHTNINGD_GOSSIP_SRC)
|
||||
# Test objects depend on ../ src and headers.
|
||||
$(GOSSIPD_TEST_OBJS): $(LIGHTNINGD_GOSSIP_HEADERS) $(LIGHTNINGD_GOSSIP_SRC)
|
||||
|
||||
ALL_OBJS += $(GOSSIPD_TEST_OBJS)
|
||||
ALL_TEST_PROGRAMS += $(GOSSIPD_TEST_PROGRAMS)
|
||||
|
@ -5,6 +5,7 @@ LIGHTNINGD_TEST_OBJS := $(LIGHTNINGD_TEST_SRC:.c=.o)
|
||||
LIGHTNINGD_TEST_PROGRAMS := $(LIGHTNINGD_TEST_OBJS:.o=)
|
||||
|
||||
ALL_TEST_PROGRAMS += $(LIGHTNINGD_TEST_PROGRAMS)
|
||||
ALL_OBJS += $(LIGHTNINGD_TEST_OBJS)
|
||||
|
||||
LIGHTNINGD_TEST_COMMON_OBJS := \
|
||||
common/daemon_conn.o \
|
||||
|
@ -14,7 +14,7 @@ update-mocks: $(WIRE_TEST_SRC:%=update-mocks/%)
|
||||
$(WIRE_TEST_PROGRAMS): $(WIRE_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
|
||||
|
||||
# Test objects require source to be generated, since they include ..
|
||||
$(WIRE_TEST_OBJS): $(WIRE_GEN_SRC)
|
||||
$(WIRE_TEST_OBJS): $(WIRE_GEN_SRC) $(WIRE_SRC) $(WIRE_HEADERS)
|
||||
|
||||
ALL_OBJS += $(WIRE_TEST_OBJS)
|
||||
ALL_TEST_PROGRAMS += $(WIRE_TEST_PROGRAMS)
|
||||
|
Loading…
Reference in New Issue
Block a user