Skip to content

Commit

Permalink
Merge bitcoin#29377: test: Add makefile target for running unit tests
Browse files Browse the repository at this point in the history
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#20264.

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

Tree-SHA512: 470969d44585d7cc33ad038a16e791db9e2be8469f52ddf122c46f20776fad34e6a48f988861a132c42540158fed05f3cf66fcc3bea05708253daaa35af54339
  • Loading branch information
achow101 authored and PastaPastaPasta committed Oct 24, 2024
1 parent 03e0bd3 commit f096880
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f096880

Please sign in to comment.