cmake: Rework tests target for Coverage configuartion and multi-config generators #1592

pull hebasto wants to merge 2 commits into bitcoin-core:master from hebasto:240818-coverage changing 3 files +34 −9
  1. hebasto commented at 3:15 pm on August 18, 2024: member

    The “experimental” status of the CMake-based build system can be reconsidered once it is adopted in the Bitcoin Core project. Fixing all known bugs is essential before this reconsideration.

    Currently, I’m aware of a single issue: when using a multi-config generator, such as “Ninja Multi-Config”, the build system still builds the tests binary for the “Coverage” configuration, which is meaningless:

    0$ cmake -B build -G "Ninja Multi-Config"
    1$ cmake --build build --config Coverage
    2[18/19] Building C object src/CMakeFiles/tests.dir/Coverage/tests.c.o
    3/home/hebasto/git/secp256k1/secp256k1/src/tests.c:18:13: note: ‘#pragma message: Defining VERIFY for tests being built for coverage analysis support is meaningless.’
    4   18 |     #pragma message("Defining VERIFY for tests being built for coverage analysis support is meaningless.")
    5      |             ^~~~~~~
    6[19/19] Linking C executable src/Coverage/tests
    

    This PR fixes the issue.

    It is an alternative to #1251 and #1291.

    The last commit aaditionally addresses that comment.

  2. cmake: Rework `tests` target for Coverage and multi-config generators 87534e72a1
  3. autotools, docs: Adjust help string for `--enable-coverage` option 5a2b84b4c9
  4. hebasto marked this as a draft on Aug 18, 2024
  5. real-or-random commented at 2:55 pm on August 19, 2024: contributor
    @hebasto Can you summarize what this PR does and why is it preferable to #1291? The approach in #1291 seemed natural to me.

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-12-22 05:15 UTC

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