Changeset View
Changeset View
Standalone View
Standalone View
test/CMakeLists.txt
Show All 11 Lines | |||||
endif() | endif() | ||||
if(NOT BUILD_BITCOIN_TX OR NOT BUILD_BITCOIN_TX) | if(NOT BUILD_BITCOIN_TX OR NOT BUILD_BITCOIN_TX) | ||||
set(BUILD_BITCOIN_UTILS_TRUE "#") | set(BUILD_BITCOIN_UTILS_TRUE "#") | ||||
endif() | endif() | ||||
if(NOT BUILD_BITCOIN_ZMQ) | if(NOT BUILD_BITCOIN_ZMQ) | ||||
set(ENABLE_ZMQ_TRUE "#") | set(ENABLE_ZMQ_TRUE "#") | ||||
endif() | endif() | ||||
if(NOT "fuzzer" IN_LIST ENABLE_SANITIZERS) | |||||
set(ENABLE_FUZZ_TRUE "#") | |||||
endif() | |||||
# Create build ini file | # Create build ini file | ||||
configure_file(config.ini.in config.ini @ONLY) | configure_file(config.ini.in config.ini @ONLY) | ||||
### | ### | ||||
# Setup symlinks for testing | # Setup symlinks for testing | ||||
### | ### | ||||
include(SanitizeHelper) | include(SanitizeHelper) | ||||
function(make_link file) | function(make_link file) | ||||
set(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}") | set(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}") | ||||
set(dest "${CMAKE_CURRENT_BINARY_DIR}/${file}") | set(dest "${CMAKE_CURRENT_BINARY_DIR}/${file}") | ||||
# Create the target directory and parents if needed. | |||||
get_filename_component(dest_dir "${dest}" DIRECTORY) | |||||
file(MAKE_DIRECTORY "${dest_dir}") | |||||
add_custom_command( | add_custom_command( | ||||
OUTPUT "${dest}" | OUTPUT "${dest}" | ||||
COMMAND ${CMAKE_COMMAND} -E create_symlink "${src}" "${dest}" | COMMAND ${CMAKE_COMMAND} -E create_symlink "${src}" "${dest}" | ||||
COMMENT "link ${file}" | COMMENT "link ${file}" | ||||
MAIN_DEPENDENCY "${src}" | MAIN_DEPENDENCY "${src}" | ||||
) | ) | ||||
# Add a phony target to make sure the files are linked by default. | # Add a phony target to make sure the files are linked by default. | ||||
sanitize_target_name("link-" "${file}" NAME) | sanitize_target_name("link-" "${file}" NAME) | ||||
add_custom_target(${NAME} ALL DEPENDS "${dest}") | add_custom_target(${NAME} ALL DEPENDS "${dest}") | ||||
endfunction() | endfunction() | ||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional/) | |||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/util/) | |||||
make_link(functional/test_runner.py) | make_link(functional/test_runner.py) | ||||
make_link(util/bitcoin-util-test.py) | make_link(util/bitcoin-util-test.py) | ||||
make_link(util/rpcauth-test.py) | make_link(util/rpcauth-test.py) | ||||
make_link(fuzz/test_runner.py) | |||||
macro(add_functional_test_check TARGET COMMENT) | macro(add_functional_test_check TARGET COMMENT) | ||||
add_custom_target(${TARGET} | add_custom_target(${TARGET} | ||||
COMMENT "${COMMENT}" | COMMENT "${COMMENT}" | ||||
COMMAND | COMMAND | ||||
"${Python_EXECUTABLE}" | "${Python_EXECUTABLE}" | ||||
./functional/test_runner.py | ./functional/test_runner.py | ||||
${ARGN} | ${ARGN} | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |