[rfc] Replacing Boost Unit Test Framework? #34666

issue maflcko openend this issue on February 25, 2026
  1. maflcko commented at 9:00 am on February 25, 2026: member

    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:

    Are there any other missing features?

    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)

  2. maflcko added the label Brainstorming on Feb 25, 2026
  3. maflcko added the label Tests on Feb 25, 2026
  4. hodlinator commented at 2:06 pm on February 25, 2026: contributor

    Note that in the case of #33878 (comment) the tests are being run directly through:

    0./bin/test_bitcoin.exe -l test_suite
    1Running 725 test cases...
    2Entering 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.

  5. maflcko commented at 2:12 pm on February 25, 2026: member

    CTest

    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.

  6. hodlinator commented at 2:17 pm on February 25, 2026: contributor

    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.

  7. maflcko commented at 3:47 pm on February 25, 2026: member

    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.

  8. brunoerg commented at 1:02 pm on March 4, 2026: contributor

    There is no –fail-fast option, possibly even attaching gdb automatically (https://github.com/bitcoin/bitcoin/issues/8670#issuecomment-247083981)

    A --fail-fast option would be super valuable for mutation testing.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-09 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me