This PR:
-
Switches to a modern CMake approach by using the
Python3::Interpreter
imported target, which is more robust than using variables. -
Disables the
util_rpcauth_test
test explicitly instead of silently ignoring it.
A build and test log for the case when Python is unavailable is provided below:
0$ cmake -B build
1$ cmake --build build -j 16
2$ ctest --test-dir build -j $(nproc) -R "^util"
3Internal ctest changing into directory: /bitcoin/build
4Test project /bitcoin/build
5 Start 115: util_tests
6 Start 117: util_trace_tests
7 Start 114: util_string_tests
8 Start 116: util_threadnames_tests
9 Start 1: util_rpcauth_test
101/5 Test [#1](/bitcoin-bitcoin/1/): util_rpcauth_test ................***Not Run (Disabled) 0.00 sec
112/5 Test [#114](/bitcoin-bitcoin/114/): util_string_tests ................ Passed 0.11 sec
123/5 Test [#117](/bitcoin-bitcoin/117/): util_trace_tests ................. Passed 0.11 sec
134/5 Test [#116](/bitcoin-bitcoin/116/): util_threadnames_tests ........... Passed 0.11 sec
145/5 Test [#115](/bitcoin-bitcoin/115/): util_tests ....................... Passed 0.13 sec
15
16100% tests passed, 0 tests failed out of 4
17
18Total Test time (real) = 0.13 sec
19
20The following tests did not run:
21 1 - util_rpcauth_test (Disabled)