Skip to content

Commit

Permalink
makefiles: move all unit tests under make check-units
Browse files Browse the repository at this point in the history
Isolate unit tests under their own make directive.
  • Loading branch information
niftynei authored and rustyrussell committed Jun 30, 2019
1 parent 267d627 commit 7046d02
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ else
PYTEST_OPTS += -x
endif

check:
check-units:

check: check-units
$(MAKE) installcheck
$(MAKE) pytest

Expand Down
2 changes: 1 addition & 1 deletion bitcoin/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ ALL_OBJS += $(BITCOIN_TEST_PROGRAMS:=.o)
bitcoin/test/run-secret_eq_consttime.o: CFLAGS += -DCOPTFLAGS="\"${COPTFLAGS}\""
update-mocks: $(BITCOIN_TEST_SRC:%=update-mocks/%)

check: $(BITCOIN_TEST_PROGRAMS:%=unittest/%)
check-units: $(BITCOIN_TEST_PROGRAMS:%=unittest/%)
2 changes: 1 addition & 1 deletion channeld/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ $(CHANNELD_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CHANNELD_

$(CHANNELD_TEST_OBJS): $(LIGHTNING_CHANNELD_HEADERS) $(LIGHTNING_CHANNELD_SRC)

check: $(CHANNELD_TEST_PROGRAMS:%=unittest/%)
check-units: $(CHANNELD_TEST_PROGRAMS:%=unittest/%)
2 changes: 1 addition & 1 deletion cli/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ $(CLI_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CLI_TEST_COMMO

$(CLI_TEST_OBJS): $(LIGHTNING_CLI_HEADERS) $(LIGHTNING_CLI_SRC)

check: $(CLI_TEST_PROGRAMS:%=unittest/%)
check-units: $(CLI_TEST_PROGRAMS:%=unittest/%)
2 changes: 1 addition & 1 deletion common/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ ALL_OBJS += $(COMMON_TEST_PROGRAMS:=.o)

update-mocks: $(COMMON_TEST_SRC:%=update-mocks/%)

check: $(COMMON_TEST_PROGRAMS:%=unittest/%)
check-units: $(COMMON_TEST_PROGRAMS:%=unittest/%)
2 changes: 1 addition & 1 deletion connectd/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
check: connectd-tests
check-units: connectd-tests

# Note that these actually #include everything they need, except ccan/ and bitcoin/.
# That allows for unit testing of statics, and special effects.
Expand Down
3 changes: 2 additions & 1 deletion doc/HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ There are three kinds of tests:
header order, and checks formatted quotes from BOLTs if BOLTDIR
exists.

* **unit tests** - standalone programs that can be run individually.
* **unit tests** - standalone programs that can be run individually. You can
also run all of the unit tests with `make check-units`.
They are `run-*.c` files in test/ subdirectories used to test routines
inside C source files.

Expand Down
2 changes: 1 addition & 1 deletion gossipd/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
check: gossipd-tests
check-units: gossipd-tests

# Note that these actually #include everything they need, except ccan/ and bitcoin/.
# That allows for unit testing of statics, and special effects.
Expand Down
2 changes: 1 addition & 1 deletion lightningd/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ $(LIGHTNINGD_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIGHTNI

$(LIGHTNINGD_TEST_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_SRC)

check: $(LIGHTNINGD_TEST_PROGRAMS:%=unittest/%)
check-units: $(LIGHTNINGD_TEST_PROGRAMS:%=unittest/%)
2 changes: 1 addition & 1 deletion onchaind/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
check: onchaind-tests
check-units: onchaind-tests

# Note that these actually #include everything they need, except ccan/ and bitcoin/.
# That allows for unit testing of statics, and special effects.
Expand Down
2 changes: 1 addition & 1 deletion wallet/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ $(WALLET_TEST_OBJS): $(WALLET_SRC)

update-mocks: $(WALLET_TEST_SRC:%=update-mocks/%)

check: $(WALLET_TEST_PROGRAMS:%=unittest/%)
check-units: $(WALLET_TEST_PROGRAMS:%=unittest/%)
2 changes: 1 addition & 1 deletion wire/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
check: wire-tests
check-units: wire-tests

# Note that these actually #include everything they need, except ccan/ and bitcoin/.
# That allows for unit testing of statics, and special effects.
Expand Down

0 comments on commit 7046d02

Please sign in to comment.