core-lightning/onchaind/test/Makefile
niftynei fbe50e087a setup: create a common setup which will handle the wally-context
Since we now over-write the wally malloc/free functions, we need to do
so for tests as well. Here we pull up all of the common setup/teardown
logic into a separate place, and update the tests that use libwally to
use the new common_setup core

Changelog-None
2020-05-19 13:35:42 +09:30

29 lines
895 B
Makefile

check-units: onchaind-tests
# Note that these actually #include everything they need, except ccan/ and bitcoin/.
# That allows for unit testing of statics, and special effects.
ONCHAIND_TEST_SRC := $(wildcard onchaind/test/run-*.c)
ONCHAIND_TEST_OBJS := $(ONCHAIND_TEST_SRC:.c=.o)
ONCHAIND_TEST_PROGRAMS := $(ONCHAIND_TEST_OBJS:.o=)
ONCHAIND_TEST_COMMON_OBJS := \
common/amount.o \
common/features.o \
common/pseudorand.o \
common/setup.o \
common/type_to_string.o \
common/utils.o
update-mocks: $(ONCHAIND_TEST_SRC:%=update-mocks/%)
$(ONCHAIND_TEST_PROGRAMS): $(ONCHAIND_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
# Test objects depend on ../ src and headers.
$(ONCHAIND_TEST_OBJS): $(LIGHTNINGD_ONCHAIN_HEADERS) $(LIGHTNINGD_ONCHAIN_SRC)
ALL_OBJS += $(ONCHAIND_TEST_OBJS)
ALL_TEST_PROGRAMS += $(ONCHAIND_TEST_PROGRAMS)
onchaind-tests: $(ONCHAIND_TEST_PROGRAMS:%=unittest/%)