2019-06-20 20:13:14 +02:00
|
|
|
check-units: onchaind-tests
|
2018-04-03 09:19:45 +02:00
|
|
|
|
|
|
|
# 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=)
|
|
|
|
|
2020-08-31 03:13:25 +02:00
|
|
|
ALL_C_SOURCES += $(ONCHAIND_TEST_SRC)
|
|
|
|
ALL_TEST_PROGRAMS += $(ONCHAIND_TEST_PROGRAMS)
|
|
|
|
|
2018-04-03 09:19:45 +02:00
|
|
|
ONCHAIND_TEST_COMMON_OBJS := \
|
2019-02-21 04:45:55 +01:00
|
|
|
common/amount.o \
|
2021-09-21 09:23:10 +02:00
|
|
|
common/autodata.o \
|
2018-04-03 09:19:45 +02:00
|
|
|
common/features.o \
|
|
|
|
common/pseudorand.o \
|
2020-05-16 00:13:22 +02:00
|
|
|
common/setup.o \
|
2018-04-03 09:19:45 +02:00
|
|
|
common/type_to_string.o \
|
|
|
|
common/utils.o
|
|
|
|
|
|
|
|
$(ONCHAIND_TEST_PROGRAMS): $(ONCHAIND_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
|
|
|
|
|
2020-12-03 02:21:59 +01:00
|
|
|
# This needs many more objs:
|
|
|
|
onchaind/test/run-onchainstress: \
|
|
|
|
common/htlc_tx.o \
|
|
|
|
common/derive_basepoints.o \
|
|
|
|
common/daemon.o \
|
|
|
|
common/htlc_wire.o \
|
|
|
|
common/initial_commit_tx.o \
|
|
|
|
common/key_derive.o \
|
|
|
|
common/keyset.o \
|
|
|
|
common/permute_tx.o \
|
|
|
|
common/subdaemon.o \
|
|
|
|
common/wallet.o \
|
|
|
|
wire/towire.o \
|
|
|
|
wire/fromwire.o
|
|
|
|
|
2018-04-03 09:19:45 +02:00
|
|
|
# Test objects depend on ../ src and headers.
|
2020-08-31 03:13:25 +02:00
|
|
|
$(ONCHAIND_TEST_OBJS): $(ONCHAIND_HEADERS) $(ONCHAIND_SRC)
|
2018-04-03 09:19:45 +02:00
|
|
|
|
|
|
|
onchaind-tests: $(ONCHAIND_TEST_PROGRAMS:%=unittest/%)
|
|
|
|
|