cmake: Use “coverage” preset instead of “Coverage” build type and document it #1251

pull hebasto wants to merge 2 commits into bitcoin-core:master from hebasto:230328-coverage changing 4 files +35 −17
  1. hebasto commented at 2:00 pm on March 28, 2023: member

    Using -DCMAKE_BUILD_TYPE=Coverage to configure the build for coverage analysis has a flaw as build types are not defined at the configuration stage for multi-config generators.

    This PR implements the idea suggested here.

    Please note that both added to the README.md commands, cmake --build build and ctest --test-dir build, accept the -j $(nproc) option to parallelize work.

    Drafted as it is based on #1234.

  2. hebasto force-pushed on Mar 28, 2023
  3. hebasto cross-referenced this on Mar 28, 2023 from issue build: Meta-issue for follow-ups to initial CMake merge (#1113) by hebasto
  4. in CMakePresets.json:23 in ba602344ba outdated
    22+    {
    23+      "name": "coverage",
    24+      "displayName": "Build for coverage analysis",
    25+      "generator": "Unix Makefiles",
    26+      "cacheVariables": {
    27+        "CMAKE_C_COMPILER": "gcc",
    


    real-or-random commented at 9:33 pm on March 28, 2023:
    https://clang.llvm.org/docs/SourceBasedCodeCoverage.html clang supports this too, so no need to set a default here, I think.

    hebasto commented at 11:22 am on March 29, 2023:
    Doesn’t clang require the use of the llvm-cov tool, which is currently undocumented in the README.md?
  5. theuni commented at 10:09 am on April 27, 2023: contributor
    Concept ACK assuming one can stack multiple presets at once.
  6. cmake: Use "coverage" preset instead of "Coverage" build type 19ead5e5e6
  7. cmake, doc: Document test coverage using CMake-based build system 98bed068c6
  8. hebasto force-pushed on Apr 27, 2023
  9. hebasto marked this as ready for review on Apr 27, 2023
  10. hebasto commented at 10:37 am on April 27, 2023: member
    Rebased.
  11. theuni commented at 11:22 am on April 27, 2023: contributor

    After a discussion about this in-person, we’ve found drawbacks in the build type approach as well as the preset one.

    Instead, let’s just do the simple thing and hook up a new option.

  12. hebasto marked this as a draft on Apr 28, 2023
  13. hebasto cross-referenced this on Apr 29, 2023 from issue cmake: Use `SECP256K1_COVERAGE` option instead of `CMAKE_BUILD_TYPE=Coverage` by hebasto
  14. hebasto commented at 10:44 pm on April 29, 2023: member

    After a discussion about this in-person, we’ve found drawbacks in the build type approach as well as the preset one.

    Instead, let’s just do the simple thing and hook up a new option.

    Closing in favour of #1291.

  15. hebasto closed this on Apr 29, 2023

  16. hebasto deleted the branch on Jun 6, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-24 14:15 UTC

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