test: Remove `mock_process.cpp` #35701

pull rustaceanrob wants to merge 1 commits into bitcoin:master from rustaceanrob:26-7-10-mock changing 4 files +48 −60
  1. rustaceanrob commented at 11:52 AM on July 10, 2026: member

    Picked from #35587, but I think has motivation to go in on its own.

    The previous binary used a number of Boost.Test features:

    • boost::unit_test::disable
    • BOOST_FAIL
    • boost::exit_test_failure

    This patch duplicates the previous mock process behavior with no boost features.

    With the patch we can:

    • simplify the test config
    • remove a linted boost include
    • remove a file that was not actually a test
  2. DrahtBot added the label Tests on Jul 10, 2026
  3. DrahtBot commented at 11:53 AM on July 10, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35701.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK kevkevinpal, maflcko
    Approach ACK hebasto

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35587 (Remove boost as a unit test runner by rustaceanrob)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. hebasto commented at 12:17 PM on July 10, 2026: member

    Concept ACK.

  5. in src/test/system_tests.cpp:63 in cc6c4fed5a
      59 | +        }
      60 | +        std::cerr << "Unknown mock process: " << n << std::endl;
      61 | +        std::_Exit(EXIT_FAILURE);
      62 | +    }
      63 | +};
      64 | +const MockProcessDispatcher g_mock_dispatcher;
    


    maflcko commented at 2:53 PM on July 10, 2026:

    nit: I don't think there needs to be a dispatcher class. It can be a plain lambda:

    const bool g_maybe_run_mock_dispatcher_before_main{[]() {
        const char* name = std::getenv("MOCK_PROCESS_ENV");
        if (!name) return false;
        // exit code ...
        std::_Exit(EXIT_FAILURE);
    }()};
    

    This should allow to remove 5 more lines of code 😅

  6. maflcko approved
  7. maflcko commented at 2:55 PM on July 10, 2026: member

    Nice. Using vanilla C++ was also my recommendation in #34791 (comment). Thanks for implementing it!

    lgtm, but I left a nit to remove even more lines of code

  8. in src/test/system_tests.cpp:12 in cc6c4fed5a
       8 | @@ -9,35 +9,72 @@
       9 |  #include <test/util/common.h>
      10 |  #include <test/util/setup_common.h>
      11 |  #include <univalue.h>
      12 | +#include <util/fs.h>
    


    hebasto commented at 7:48 PM on July 10, 2026:

    This header seems unnecessary.

  9. hebasto commented at 7:48 PM on July 10, 2026: member

    Approach ACK cc6c4fed5aa28cd79ca3fe84374837987d606932.

    Tested on Fedora 44 , OpenIndiana, and Windows (Debug configuration).

  10. test: Remove `mock_process.cpp`
    The previous binary used a number of `Boost.Test` features:
    - `boost::unit_test::disable`
    - `BOOST_FAIL`
    - `boost::exit_test_failure`
    
    This patch duplicates the previous mock process behavior with no boost features.
    
    With the patch we can:
    - simplify the test config
    - remove a linted boost include
    - remove a file that was not actually a test
    63c5f9d22c
  11. rustaceanrob force-pushed on Jul 11, 2026
  12. rustaceanrob commented at 11:06 AM on July 11, 2026: member

    Addressed feedback 63c5f9d22c0be3db47779d37aae15aa512ff1ebb

  13. kevkevinpal commented at 1:59 PM on July 11, 2026: contributor

    ACK 63c5f9d

    I tested this on Fedora 40, I agree with the motivation of removing this on its own. Also, if merged simplifies the diff of https://github.com/bitcoin/bitcoin/pull/35587

  14. DrahtBot requested review from hebasto on Jul 11, 2026
  15. maflcko commented at 2:33 PM on July 11, 2026: member

    review ACK 63c5f9d22c0be3db47779d37aae15aa512ff1ebb 🧀

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: review ACK 63c5f9d22c0be3db47779d37aae15aa512ff1ebb 🧀
    DVdzvNBRU90yL96xvRz2FSUBOx4xn753lDoXN0z7DvWYuqyPeCyETSYLcuAq5gpmMdN1aCJXB/RIxEcXvJaZCg==
    

    </details>


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-07-11 18:51 UTC

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