Skip to content

Commit 7651432

Browse files
committed
Run unit tests in parallel
Signed-off-by: Julian Fleischer <[email protected]>
1 parent db2dbc9 commit 7651432

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/Makefile.test.include

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Distributed under the MIT software license, see the accompanying
33
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
TESTS += test/test_unite
65
bin_PROGRAMS += test/test_unite
76
noinst_PROGRAMS += test/test_unite_fuzzy
87
TEST_SRCDIR = test
@@ -23,6 +22,14 @@ RAW_TEST_FILES =
2322

2423
GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
2524

25+
UNITE_TEST_SUITE = \
26+
test/test_unite.h \
27+
test/test_unite.cpp \
28+
test/test_unite_block_fixture.h \
29+
test/test_unite_block_fixture.cpp \
30+
test/test_unite_main.cpp \
31+
test/test_unite_mocks.h
32+
2633
# test_unite binary #
2734
UNITE_TESTS = \
2835
test/arith_uint256_tests.cpp \
@@ -123,12 +130,6 @@ UNITE_TESTS = \
123130
test/staking/coin_tests.cpp \
124131
test/staking/proof_of_stake_tests.cpp \
125132
test/streams_tests.cpp \
126-
test/test_unite.h \
127-
test/test_unite.cpp \
128-
test/test_unite_block_fixture.h \
129-
test/test_unite_block_fixture.cpp \
130-
test/test_unite_main.cpp \
131-
test/test_unite_mocks.h \
132133
test/timedata_tests.cpp \
133134
test/torcontrol_tests.cpp \
134135
test/transaction_tests.cpp \
@@ -159,11 +160,13 @@ UNITE_TESTS += \
159160
test/validation_block_tests.cpp \
160161
test/waiter_tests.cpp \
161162
wallet/test/rpcvalidator_tests.cpp \
162-
wallet/test/wallet_test_fixture.cpp \
163-
wallet/test/wallet_test_fixture.h \
164163
wallet/test/accounting_tests.cpp \
165164
wallet/test/wallet_tests.cpp \
166165
wallet/test/crypto_tests.cpp
166+
167+
UNITE_TEST_SUITE += \
168+
wallet/test/wallet_test_fixture.cpp \
169+
wallet/test/wallet_test_fixture.h
167170
endif
168171

169172
if ENABLE_USBDEVICE
@@ -172,7 +175,7 @@ UNITE_TESTS += \
172175
test/ledger_apdu_tests.cpp
173176
endif
174177

175-
test_test_unite_SOURCES = $(UNITE_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
178+
test_test_unite_SOURCES = $(UNITE_TEST_SUITE) $(UNITE_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
176179
test_test_unite_CPPFLAGS = $(AM_CPPFLAGS) $(UNITE_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS)
177180
test_test_unite_LDADD =
178181
if ENABLE_WALLET
@@ -227,14 +230,18 @@ unite_test_check: $(TEST_BINARY) FORCE
227230
unite_test_clean : FORCE
228231
rm -f $(CLEAN_UNITE_TEST) $(test_test_unite_OBJECTS) $(TEST_BINARY)
229232

230-
check-local:
233+
check-local: $(UNITE_TESTS:.cpp=.cpp.test)
231234
@echo "Running test/util/unite-util-test.py..."
232235
$(PYTHON) $(top_builddir)/test/util/unite-util-test.py
233236
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
234237
if EMBEDDED_UNIVALUE
235238
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check
236239
endif
237240

241+
%.cpp.test: %.cpp
242+
@echo Running tests: `cat $< | grep "BOOST_FIXTURE_TEST_SUITE(\|BOOST_AUTO_TEST_SUITE(" | cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1` from $<
243+
$(AM_V_at)$(TEST_BINARY) -l test_suite -t "`cat $< | grep "BOOST_FIXTURE_TEST_SUITE(\|BOOST_AUTO_TEST_SUITE(" | cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1`" > $<.log 2>&1 || (cat $<.log && false)
244+
238245
%.json.h: %.json
239246
@$(MKDIR_P) $(@D)
240247
@{ \

0 commit comments

Comments
 (0)