cmake: Use full signature of `add_test()` command #1289

pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:230429-tests changing 3 files +7 −7
  1. hebasto commented at 8:56 AM on April 29, 2023: member

    This PR fixes tests for Windows binaries using Wine:

    $ cmake -S . -B ../mingw -DCMAKE_TOOLCHAIN_FILE=cmake/x86_64-w64-mingw32.toolchain.cmake
    $ cmake --build ../mingw
    $ cmake --build ../mingw -t check
    Test project /home/hebasto/git/secp256k1/mingw
        Start 1: noverify_tests
    Could not find executable noverify_tests
    ...
    
  2. cmake: Use full signature of `add_test()` command
    An executable target in the `COMMAND` option will automatically be
    replaced by the location of the executable created at build time.
    
    This change fixes tests for Windows binaries using Wine.
    755629bc03
  3. hebasto cross-referenced this on Apr 29, 2023 from issue cmake: Set `ENVIRONMENT` property for examples on Windows by hebasto
  4. real-or-random commented at 1:20 PM on April 29, 2023: contributor

    Concept ACK

    Mostly because I'm curious: Do you know why this fixes tests? After reading the docs in https://cmake.org/cmake/help/latest/command/add_test.html, I don't see how the full syntax should make a difference here.

    Nevermind, I found it:

    Unlike the above NAME signature, target names are not supported in the command-line.

  5. in .cirrus.yml:406 in 755629bc03
     402 | @@ -403,7 +403,7 @@ task:
     403 |      - cmake --build build --config RelWithDebInfo -- -property:UseMultiToolTask=true;CL_MPcount=5
     404 |    check_script:
     405 |      - '%x64_NATIVE_TOOLS%'
     406 | -    - ctest --test-dir build -j 5
     407 | +    - ctest -C RelWithDebInfo --test-dir build -j 5
    


    real-or-random commented at 1:24 PM on April 29, 2023:

    Is this change necessary? Shouldn't that be the default already?


    hebasto commented at 1:56 PM on April 29, 2023:

    Is this change necessary?

    It is.

    Shouldn't that be the default already?

    Otherwise, for multi-config generators, ctest complains:

    Test not available without configuration.  (Missing "-C <config>"?)
    
  6. real-or-random approved
  7. real-or-random commented at 3:10 PM on April 29, 2023: contributor

    ACK 755629bc032af155ff68fa820244d04cb80547c5

  8. real-or-random merged this on Apr 29, 2023
  9. real-or-random closed this on Apr 29, 2023

  10. hebasto deleted the branch on Apr 29, 2023
  11. sipa referenced this in commit b4eb644b6c on May 12, 2023
  12. hebasto referenced this in commit 49c52ea2b1 on May 13, 2023
  13. vmta referenced this in commit e1120c94a1 on Jun 4, 2023
  14. sipa referenced this in commit 901336eee7 on Jun 21, 2023
  15. vmta referenced this in commit 8f03457eed on Jul 1, 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: 2026-04-14 11:15 UTC

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