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

5ca9b24da18e842e7a093dc44f6b222af73e92cf 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 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  edilmedeiros:
    Tested ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  achow101:
    ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  ryanofsky:
    Tested ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf.

Tree-SHA512: 470969d44585d7cc33ad038a16e791db9e2be8469f52ddf122c46f20776fad34e6a48f988861a132c42540158fed05f3cf66fcc3bea05708253daaa35af54339
This commit is contained in:
Ava Chow 2024-02-08 18:01:32 -05:00 committed by pasta
parent 03e0bd3347
commit f0968807bc
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38
2 changed files with 5 additions and 2 deletions

View File

@ -367,7 +367,9 @@ dash_test_check: $(TEST_BINARY) FORCE
dash_test_clean : FORCE
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_dash_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/bitcoin-util-test.py..."
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py

View File

@ -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_dash`. To recompile
after a test file was modified, run `make` and then run the test again. If you