2018-07-24 08:18:58 +02:00
|
|
|
# Note that these actually #include everything they need, except ccan/ and bitcoin/.
|
|
|
|
# That allows for unit testing of statics, and special effects.
|
|
|
|
CONNECTD_TEST_SRC := $(wildcard connectd/test/run-*.c)
|
|
|
|
CONNECTD_TEST_OBJS := $(CONNECTD_TEST_SRC:.c=.o)
|
|
|
|
CONNECTD_TEST_PROGRAMS := $(CONNECTD_TEST_OBJS:.o=)
|
|
|
|
|
|
|
|
CONNECTD_TEST_COMMON_OBJS := \
|
|
|
|
common/features.o \
|
|
|
|
common/pseudorand.o \
|
2020-12-02 01:10:04 +01:00
|
|
|
common/setup.o \
|
2018-07-24 08:18:58 +02:00
|
|
|
common/type_to_string.o \
|
|
|
|
common/utils.o
|
|
|
|
|
2020-09-09 12:35:10 +02:00
|
|
|
ALL_C_SOURCES += $(CONNECTD_TEST_SRC)
|
2020-08-31 03:13:25 +02:00
|
|
|
ALL_TEST_PROGRAMS += $(CONNECTD_TEST_PROGRAMS)
|
|
|
|
|
2018-07-24 08:18:58 +02:00
|
|
|
update-mocks: $(CONNECTD_TEST_SRC:%=update-mocks/%)
|
|
|
|
|
|
|
|
$(CONNECTD_TEST_PROGRAMS): $(CONNECTD_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
|
|
|
|
|
|
|
|
# Test objects depend on ../ src and headers.
|
2020-08-31 03:13:25 +02:00
|
|
|
$(CONNECTD_TEST_OBJS): $(CONNECTD_HEADERS) $(CONNECTD_SRC)
|
2018-07-24 08:18:58 +02:00
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
check-units: $(CONNECTD_TEST_PROGRAMS:%=unittest/%)
|
2018-07-24 08:18:58 +02:00
|
|
|
|