Skip to content

Commit

Permalink
cmake, test: Disable tests instead of ignoring them
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Nov 6, 2024
1 parent 4d5bc29 commit 8e69fe5
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions cmake/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.

if(TARGET bitcoin-util AND TARGET bitcoin-tx AND TARGET Python3::Interpreter)
add_test(NAME util_test_runner
COMMAND Python3::Interpreter ${PROJECT_BINARY_DIR}/test/util/test_runner.py
)
set_property(TEST util_test_runner PROPERTY
ENVIRONMENT_MODIFICATION
BITCOINUTIL=set:$<TARGET_FILE:bitcoin-util>
BITCOINTX=set:$<TARGET_FILE:bitcoin-tx>
)
endif()
add_test(NAME util_test_runner
COMMAND Python3::Interpreter ${PROJECT_BINARY_DIR}/test/util/test_runner.py
)
set_property(TEST util_test_runner PROPERTY
ENVIRONMENT_MODIFICATION
BITCOINUTIL=set:$<TARGET_FILE:bitcoin-util>
BITCOINTX=set:$<TARGET_FILE:bitcoin-tx>
)
set_tests_properties(util_test_runner PROPERTIES
DISABLED $<NOT:$<AND:$<TARGET_EXISTS:Python3::Interpreter>,$<TARGET_EXISTS:bitcoin-util>,$<TARGET_EXISTS:bitcoin-tx>>>
)

if(TARGET Python3::Interpreter)
add_test(NAME util_rpcauth_test
COMMAND Python3::Interpreter ${PROJECT_BINARY_DIR}/test/util/rpcauth-test.py
)
endif()
add_test(NAME util_rpcauth_test
COMMAND Python3::Interpreter ${PROJECT_BINARY_DIR}/test/util/rpcauth-test.py
)
set_tests_properties(util_rpcauth_test PROPERTIES
DISABLED $<NOT:$<TARGET_EXISTS:Python3::Interpreter>>
)

0 comments on commit 8e69fe5

Please sign in to comment.