mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 02:27:51 +01:00
c8aa50a382
I had a routing problem, and wrote a simple unit test which passed. So I wrote one which copied the failure case (and importantly, had a non-1 fee factor), which triggerd it. In that real example, we underflowed which resulted in us not finding a route. Simply don't consider routes which are infinite. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
26 lines
818 B
Makefile
26 lines
818 B
Makefile
check: gossipd-tests
|
|
|
|
# Note that these actually #include everything they need, except ccan/ and bitcoin/.
|
|
# That allows for unit testing of statics, and special effects.
|
|
GOSSIPD_TEST_SRC := $(wildcard gossipd/test/run-*.c)
|
|
GOSSIPD_TEST_OBJS := $(GOSSIPD_TEST_SRC:.c=.o)
|
|
GOSSIPD_TEST_PROGRAMS := $(GOSSIPD_TEST_OBJS:.o=)
|
|
|
|
GOSSIPD_TEST_COMMON_OBJS := \
|
|
common/pseudorand.o \
|
|
common/type_to_string.o \
|
|
common/utils.o
|
|
|
|
update-mocks: $(GOSSIPD_TEST_SRC:%=update-mocks/%)
|
|
|
|
$(GOSSIPD_TEST_PROGRAMS): $(GOSSIPD_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
|
|
|
|
# Test objects require source to be generated, since they include ..
|
|
$(GOSSIPD_TEST_OBJS): $(GOSSIPD_GEN_SRC) $(LIGHTNINGD_GOSSIP_SRC)
|
|
|
|
ALL_OBJS += $(GOSSIPD_TEST_OBJS)
|
|
ALL_TEST_PROGRAMS += $(GOSSIPD_TEST_PROGRAMS)
|
|
|
|
gossipd-tests: $(GOSSIPD_TEST_PROGRAMS:%=unittest/%)
|
|
|