core-lightning/common/test/Makefile
darosior 3510c29e5d common: move json_stream helpers to common/json
Now that we have json_stream in common/, we can move all the related
helpers from lightningd/json to common/json. This way everyone can
benefit of them (including libplugin, the plugins themselves,
potentially lightning-cli), not lightningd alone!

Note that the Makefile of the common/test/ had to be modified, because
the new helpers make use of common/wireaddr... Which turns out to
\#include <lightingd/lightningd.h> ! So we couldnt just include the .c
and add mocks if we redefined some structs (hello run-param).
2020-02-04 13:24:32 +10:30

33 lines
926 B
Makefile

COMMON_TEST_SRC := $(wildcard common/test/run-*.c)
COMMON_TEST_OBJS := $(COMMON_TEST_SRC:.c=.o)
COMMON_TEST_PROGRAMS := $(COMMON_TEST_OBJS:.o=)
COMMON_TEST_COMMON_OBJS := \
common/utils.o
$(COMMON_TEST_PROGRAMS): $(COMMON_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
$(COMMON_TEST_OBJS): $(COMMON_HEADERS) $(WIRE_HEADERS) $(COMMON_SRC)
ALL_TEST_PROGRAMS += $(COMMON_TEST_PROGRAMS)
ALL_OBJS += $(COMMON_TEST_PROGRAMS:=.o)
# Sphinx test wants to decode TLVs.
common/test/run-sphinx: wire/gen_onion_wire.o wire/towire.o wire/fromwire.o
common/test/run-param \
common/test/run-json: \
common/amount.o \
common/base32.o \
common/bigsize.o \
common/json.o \
common/json_stream.o \
common/wireaddr.o \
common/type_to_string.o \
wire/fromwire.o \
wire/gen_onion_wire.o \
wire/towire.o
update-mocks: $(COMMON_TEST_SRC:%=update-mocks/%)
check-units: $(COMMON_TEST_PROGRAMS:%=unittest/%)