You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As this has comes up sometimes, I wanted to create a thread for this.
However, when replacing the current unit test framework, it is unclear what alternative could be suitable. It doesn't really make sense to drop one dependency and add a random other one.
When it comes to features that are currently missing, I recall only those so far:
If not, it may be easier to just implement our own thread-safe check macros, which abort to provide the fail-fast behavior? (I guess that catch_system_errors will have to be disabled for that somehow, not sure how to do that)
Note that in the case of #33878 (comment) the tests are being run directly through:
./bin/test_bitcoin.exe -l test_suite
Running 725 test cases...
Entering test module "Bitcoin Core Test Suite"
If we were instead to run test_bitcoin indirectly through CTest there is --stop-on-failure which will prevent that worker thread from picking up additional tests after one fails, and make the other CTest worker threads stop after completing their current test.
Sure, but ctest is not available after the guix (or any other) cross-build, so I don't think this is a solution here. Also, ctest isn't going to offer a way to fail fast inside a test case, so that gdb can be attached on the first failure.
Sure, but ctest is not available after the guix (or any other) cross-build
The relevant parts of the build-tree would need to be copied across for CTest to work.
Tangent: I also just noticed DIR_UNIT_TEST_DATA isn't set by ci-windows-cross.py like it is by 03_test_script.sh, so script_assets_tests becomes a no-op.
The relevant parts of the build-tree would need to be copied across for CTest to work.
I don't think it is so easy. Usually, cross-compilation happens on a different storage device, or even OS (Linux->Windows), so all paths would have to re-written, at a minimum.
Another thing that is annoying is that in large tests, when a boost check failure occurs, the test will continue in CI, and produce log output, making it harder to see the actual failure. We don't tolerate check failures anyway, so they may as well be fatal (aka boost require checks).
I guess this is the third reason to prefer a faster failing macro.
FWIW, libsecp256k1 now has its own test framework.
Ah, interesting. I think after fixing up the check macro behavior to what we want (done in #35139), we can probably stick with boost for now.
I think the only remaining downside would be that boost is too slow to compile. The smallest C++ unit test framework would be doctest? But if we go the effort to replace boost with doctest, we may as well come up with a minimal unit test framework to match our needs. Or is there some other motivation other than compile time for the unit test framework after fixing the macros?
Activity
hodlinator commentedon Feb 25, 2026
Note that in the case of #33878 (comment) the tests are being run directly through:
If we were instead to run test_bitcoin indirectly through CTest there is
--stop-on-failurewhich will prevent that worker thread from picking up additional tests after one fails, and make the other CTest worker threads stop after completing their current test.maflcko commentedon Feb 25, 2026
Sure, but ctest is not available after the guix (or any other) cross-build, so I don't think this is a solution here. Also, ctest isn't going to offer a way to fail fast inside a test case, so that gdb can be attached on the first failure.
hodlinator commentedon Feb 25, 2026
The relevant parts of the build-tree would need to be copied across for CTest to work.
Tangent: I also just noticed DIR_UNIT_TEST_DATA isn't set by ci-windows-cross.py like it is by 03_test_script.sh, so
script_assets_testsbecomes a no-op.maflcko commentedon Feb 25, 2026
I don't think it is so easy. Usually, cross-compilation happens on a different storage device, or even OS (Linux->Windows), so all paths would have to re-written, at a minimum.
brunoerg commentedon Mar 4, 2026
A
--fail-fastoption would be super valuable for mutation testing.maflcko commentedon Apr 21, 2026
Another thing that is annoying is that in large tests, when a boost check failure occurs, the test will continue in CI, and produce log output, making it harder to see the actual failure. We don't tolerate check failures anyway, so they may as well be fatal (aka boost require checks).
I guess this is the third reason to prefer a faster failing macro.
hebasto commentedon Apr 21, 2026
FWIW, libsecp256k1 now has its own test framework.
maflcko commentedon Apr 22, 2026
Ah, interesting. I think after fixing up the check macro behavior to what we want (done in #35139), we can probably stick with boost for now.
I think the only remaining downside would be that boost is too slow to compile. The smallest C++ unit test framework would be doctest? But if we go the effort to replace boost with doctest, we may as well come up with a minimal unit test framework to match our needs. Or is there some other motivation other than compile time for the unit test framework after fixing the macros?
maflcko commentedon May 7, 2026
If we keep boost test framework, we may want to use an iwyu mapping: #33966 (comment)
fanquake commentedon Sep 8, 2026
Maybe another (weak) reason to drop Boost Test, see ad71957 from #36193.