An alias for the “test” target can be confusing for the downstream project.
For instance, when integrating using add_subdirectory(secp256k1 EXCLUDE_FROM_ALL)
(see https://github.com/hebasto/bitcoin/pull/192), test binaries are not being built by default. But the check
alias target is exposed to the downstream project build system, which in turn fails:
0$ make -C build check
1...
2Unable to find executable: /home/hebasto/git/bitcoin/build/src/secp256k1/src/exhaustive_tests
33/3 Test [#3](/bitcoin-core-secp256k1/3/): exhaustive_tests .................***Not Run 0.00 sec
4
50% tests passed, 3 tests failed out of 3
6
7Total Test time (real) = 0.03 sec
8
9The following tests FAILED:
10 1 - noverify_tests (Not Run)
11 2 - tests (Not Run)
12 3 - exhaustive_tests (Not Run)
13Errors while running CTest
14...
This PR fixes this issue by deleting the CTEST_TEST_TARGET_ALIAS
usage.