Skip to content

Commit 0b3202d

Browse files
committed
Merge bitcoin/bitcoin#29377: test: Add makefile target for running unit tests
5ca9b24 test: Add makefile target for running unit tests (TheCharlatan) Pull request description: `make check` runs a bunch of other subtree tests that exercise code that is hardly ever changed and have a comparatively long runtime. There seems to be no target for running just the unit tests, so add one. Alternatively the secp256k1 tests could be removed from the `check-local` target, reducing its runtime. This was rejected before though in bitcoin/bitcoin#20264. ACKs for top commit: delta1: utACK 5ca9b24 edilmedeiros: Tested ACK 5ca9b24 achow101: ACK 5ca9b24 ryanofsky: Tested ACK 5ca9b24. Tree-SHA512: 470969d44585d7cc33ad038a16e791db9e2be8469f52ddf122c46f20776fad34e6a48f988861a132c42540158fed05f3cf66fcc3bea05708253daaa35af54339
2 parents 5cdf313 + 5ca9b24 commit 0b3202d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Makefile.test.include

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ bitcoin_test_check: $(TEST_BINARY) FORCE
419419
bitcoin_test_clean : FORCE
420420
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
421421

422-
check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
422+
check-unit: $(BITCOIN_TESTS:.cpp=.cpp.test)
423+
424+
check-local: check-unit
423425
if BUILD_BITCOIN_TX
424426
@echo "Running test/util/test_runner.py..."
425427
$(PYTHON) $(top_builddir)/test/util/test_runner.py

src/test/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ that runs all of the unit tests. The main source file for the test library is fo
1515
Unit tests will be automatically compiled if dependencies were met in `./configure`
1616
and tests weren't explicitly disabled.
1717

18-
After configuring, they can be run with `make check`.
18+
After configuring, they can be run with `make check`, which includes unit tests from
19+
subtrees, or `make && make -C src check-unit` for just the unit tests.
1920

2021
To run the unit tests manually, launch `src/test/test_bitcoin`. To recompile
2122
after a test file was modified, run `make` and then run the test again. If you

0 commit comments

Comments
 (0)