2016-08-23 05:59:02 +02:00
|
|
|
check: daemon-tests
|
|
|
|
|
2016-11-08 12:26:55 +01:00
|
|
|
# We run three different bitcoinds, for different types of tests.
|
|
|
|
# Provides limited paralellism.
|
2016-11-10 14:14:49 +01:00
|
|
|
daemon-test-0-%:
|
|
|
|
NO_VALGRIND=$(NO_VALGRIND) VARIANT=0 daemon/test/test-$*
|
|
|
|
daemon-test-1-%:
|
|
|
|
NO_VALGRIND=$(NO_VALGRIND) VARIANT=1 daemon/test/test-$*
|
|
|
|
daemon-test-2-%:
|
|
|
|
NO_VALGRIND=$(NO_VALGRIND) VARIANT=2 daemon/test/test-$*
|
2016-08-23 05:59:02 +02:00
|
|
|
|
|
|
|
# These don't work in parallel, so chain the deps
|
2016-11-10 14:14:49 +01:00
|
|
|
daemon-test-0-steal: daemon-test-0-unilateral
|
|
|
|
daemon-test-0-unilateral: daemon-test-0-funding-timeout
|
|
|
|
daemon-test-0-funding-timeout: daemon-test-0-mutual-close-with-htlcs
|
|
|
|
daemon-test-0-mutual-close-with-htlcs: daemon-test-0-different-fees
|
|
|
|
daemon-test-0-different-fees: daemon-test-0-routing
|
|
|
|
daemon-test-0-routing: daemon-test-0-invoice
|
|
|
|
daemon-test-0-invoice: daemon-test-0-basic\ manual-commit
|
|
|
|
daemon-test-0-basic\ manual-commit: daemon-test-0-basic
|
|
|
|
daemon-test-0-basic: daemon-test-setup-0
|
|
|
|
|
|
|
|
daemon-test-2-steal\ --reconnect: daemon-test-2-unilateral\ --reconnect
|
|
|
|
daemon-test-2-unilateral\ --reconnect: daemon-test-2-funding-timeout\ --reconnect
|
|
|
|
daemon-test-2-funding-timeout\ --reconnect: daemon-test-2-mutual-close-with-htlcs\ --reconnect
|
|
|
|
daemon-test-2-mutual-close-with-htlcs\ --reconnect: daemon-test-2-different-fees\ --reconnect
|
|
|
|
daemon-test-2-different-fees\ --reconnect: daemon-test-2-routing\ --reconnect
|
|
|
|
daemon-test-2-routing\ --reconnect: daemon-test-2-invoice\ --reconnect
|
|
|
|
daemon-test-2-invoice\ --reconnect: daemon-test-2-basic\ manual-commit\ --reconnect
|
|
|
|
daemon-test-2-basic\ manual-commit\ --reconnect: daemon-test-2-basic\ --reconnect
|
|
|
|
daemon-test-2-basic\ --reconnect: daemon-test-setup-2
|
|
|
|
|
|
|
|
daemon-test-1-steal\ --restart: daemon-test-1-unilateral\ --restart
|
|
|
|
daemon-test-1-unilateral\ --restart: daemon-test-1-funding-timeout\ --restart
|
|
|
|
daemon-test-1-funding-timeout\ --restart: daemon-test-1-mutual-close-with-htlcs\ --restart
|
|
|
|
daemon-test-1-mutual-close-with-htlcs\ --restart: daemon-test-1-different-fees\ --restart
|
|
|
|
daemon-test-1-different-fees\ --restart: daemon-test-1-routing\ --restart
|
|
|
|
daemon-test-1-routing\ --restart: daemon-test-1-invoice\ --restart
|
|
|
|
daemon-test-1-invoice\ --restart: daemon-test-1-basic\ manual-commit\ --restart
|
|
|
|
daemon-test-1-basic\ manual-commit\ --restart: daemon-test-1-basic\ --restart
|
|
|
|
daemon-test-1-basic\ --restart: daemon-test-setup-1
|
2016-11-08 12:22:55 +01:00
|
|
|
|
|
|
|
# We shutdown first in case something is left over.
|
2016-11-08 12:26:55 +01:00
|
|
|
daemon-test-setup-%: daemon-all
|
|
|
|
VARIANT=$* daemon/test/scripts/shutdown.sh 2>/dev/null || true
|
|
|
|
VARIANT=$* daemon/test/scripts/setup.sh
|
2016-11-08 12:22:55 +01:00
|
|
|
|
2016-11-10 14:14:49 +01:00
|
|
|
daemon-test-shutdown-0: daemon-test-0-steal
|
2016-11-08 12:26:55 +01:00
|
|
|
VARIANT=0 daemon/test/scripts/shutdown.sh
|
2016-11-10 14:14:49 +01:00
|
|
|
daemon-test-shutdown-1: daemon-test-1-steal\ --restart
|
2016-11-08 12:26:55 +01:00
|
|
|
VARIANT=1 daemon/test/scripts/shutdown.sh
|
2016-11-10 14:14:49 +01:00
|
|
|
daemon-test-shutdown-2: daemon-test-2-steal\ --reconnect
|
2016-11-08 12:26:55 +01:00
|
|
|
VARIANT=2 daemon/test/scripts/shutdown.sh
|
2016-11-08 12:22:55 +01:00
|
|
|
|
2016-11-08 12:26:55 +01:00
|
|
|
# Forms long dependency chains.
|
2016-11-10 14:14:49 +01:00
|
|
|
daemon-all-test: daemon-test-shutdown-0 daemon-test-shutdown-1 daemon-test-shutdown-2
|
2016-08-23 05:59:02 +02:00
|
|
|
|
|
|
|
# Note that these actually #include everything they need, except ccan/ and bitcoin/.
|
|
|
|
# That allows for unit testing of statics, and special effects.
|
|
|
|
DAEMON_TEST_SRC := $(wildcard daemon/test/run-*.c)
|
|
|
|
DAEMON_TEST_OBJS := $(DAEMON_TEST_SRC:.c=.o)
|
|
|
|
DAEMON_TEST_PROGRAMS := $(DAEMON_TEST_OBJS:.o=)
|
|
|
|
|
2017-01-04 04:39:20 +01:00
|
|
|
update-mocks: $(DAEMON_TEST_SRC:%=update-mocks/%)
|
2016-08-23 05:59:02 +02:00
|
|
|
|
2017-01-04 04:37:15 +01:00
|
|
|
$(DAEMON_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(CORE_OBJS) libsecp256k1.a utils.o
|
2016-08-23 05:59:02 +02:00
|
|
|
|
2016-11-07 23:04:13 +01:00
|
|
|
$(DAEMON_TEST_OBJS): $(DAEMON_HEADERS) $(DAEMON_JSMN_HEADERS) $(BITCOIN_HEADERS) $(CORE_HEADERS) $(GEN_HEADERS) $(DAEMON_GEN_HEADERS) $(CCAN_HEADERS)
|
2016-08-23 05:59:02 +02:00
|
|
|
|
2016-12-02 08:40:13 +01:00
|
|
|
daemon-unit-tests: $(DAEMON_TEST_PROGRAMS:%=unittest/%)
|
2016-08-23 05:59:02 +02:00
|
|
|
|
2016-11-10 14:14:49 +01:00
|
|
|
daemon-tests: daemon-unit-tests daemon-all-test
|
2016-08-23 05:59:02 +02:00
|
|
|
|