Browse Source

bitcoin: add test programs to ALL_TEST_PROGRAMS

* Add BITCOIN_TEST_PROGRAMS to ALL_TEST_PROGRAMS
* Refactor bitcoin test make directives into its own Makefile under bitcoin/test

Signed-off-by: William Casarin <jb55@jb55.com>
ppa-0.6.1
William Casarin 7 years ago
committed by Christian Decker
parent
commit
3cb03ab784
  1. 17
      bitcoin/Makefile
  2. 15
      bitcoin/test/Makefile

17
bitcoin/Makefile

@ -38,19 +38,6 @@ check-source: $(BITCOIN_SRC:%=check-src-include-order/%) \
# Bitcoin objects depends on bitcoin/ external/ and ccan
$(BITCOIN_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(EXTERNAL_HEADERS)
# Note that these actually #include everything they need, except ccan/.
# That allows for unit testing of statics, and special effects.
BITCOIN_TEST_SRC := $(wildcard bitcoin/test/run-*.c)
BITCOIN_TEST_OBJS := $(BITCOIN_TEST_SRC:.c=.o)
BITCOIN_TEST_PROGRAMS := $(BITCOIN_TEST_OBJS:.o=)
$(BITCOIN_TEST_PROGRAMS): $(CCAN_OBJS)
$(BITCOIN_TEST_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(BITCOIN_SRC)
check: bitcoin-tests
check-source-bolt: $(BITCOIN_SRC:%=bolt-check/%) $(BITCOIN_HEADERS:%=bolt-check/%)
check-makefile: check-bitcoin-makefile
@ -60,9 +47,9 @@ check-bitcoin-makefile:
check-whitespace: $(BITCOIN_SRC:%=check-whitespace/%) $(BITCOIN_HEADERS:%=check-whitespace/%) check-whitespace/bitcoin/Makefile
bitcoin-tests: $(BITCOIN_TEST_PROGRAMS:%=unittest/%)
clean: bitcoin-clean
bitcoin-clean:
$(RM) $(BITCOIN_OBJS) $(BITCOIN_TEST_PROGRAMS) $(BITCOIN_TEST_OBJS)
include bitcoin/test/Makefile

15
bitcoin/test/Makefile

@ -0,0 +1,15 @@
BITCOIN_TEST_SRC := $(wildcard bitcoin/test/run-*.c)
BITCOIN_TEST_OBJS := $(BITCOIN_TEST_SRC:.c=.o)
BITCOIN_TEST_PROGRAMS := $(BITCOIN_TEST_OBJS:.o=)
BITCOIN_TEST_COMMON_OBJS :=
$(BITCOIN_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_TEST_COMMON_OBJS)
$(BITCOIN_TEST_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(BITCOIN_SRC)
ALL_TEST_PROGRAMS += $(BITCOIN_TEST_PROGRAMS)
ALL_OBJS += $(BITCOIN_TEST_PROGRAMS:=.o)
update-mocks: $(BITCOIN_TEST_SRC:%=update-mocks/%)
check: $(BITCOIN_TEST_PROGRAMS:%=unittest/%)
Loading…
Cancel
Save