Merge bitcoin/bitcoin#29377: test: Add makefile target for running unit tests

5ca9b24da1 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 https://github.com/bitcoin/bitcoin/pull/20264.

ACKs for top commit:
  delta1:
    utACK 5ca9b24da1
  edilmedeiros:
    Tested ACK 5ca9b24da1
  achow101:
    ACK 5ca9b24da1
  ryanofsky:
    Tested ACK 5ca9b24da1.

Tree-SHA512: 470969d44585d7cc33ad038a16e791db9e2be8469f52ddf122c46f20776fad34e6a48f988861a132c42540158fed05f3cf66fcc3bea05708253daaa35af54339
pull/29414/head
Ava Chow 9 months ago
commit 0b3202d8ef
No known key found for this signature in database
GPG Key ID: 17565732E08E5E41

@ -419,7 +419,9 @@ bitcoin_test_check: $(TEST_BINARY) FORCE
bitcoin_test_clean : FORCE
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
check-unit: $(BITCOIN_TESTS:.cpp=.cpp.test)
check-local: check-unit
if BUILD_BITCOIN_TX
@echo "Running test/util/test_runner.py..."
$(PYTHON) $(top_builddir)/test/util/test_runner.py

@ -15,7 +15,8 @@ that runs all of the unit tests. The main source file for the test library is fo
Unit tests will be automatically compiled if dependencies were met in `./configure`
and tests weren't explicitly disabled.
After configuring, they can be run with `make check`.
After configuring, they can be run with `make check`, which includes unit tests from
subtrees, or `make && make -C src check-unit` for just the unit tests.
To run the unit tests manually, launch `src/test/test_bitcoin`. To recompile
after a test file was modified, run `make` and then run the test again. If you

Loading…
Cancel
Save