diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,6 +25,7 @@ option(ENABLE_NOTIFICATIONS "Enable desktop notifications" ON) option(ENABLE_WERROR "Promote some compiler warnings to errors" OFF) option(START_WITH_UPNP "Make UPnP the default to map ports" OFF) +option(TEST_WITH_UPGRADE_ACTIVATED "Run the tests with the next upgrade activated in addition to regular tests" OFF) # Allow usage of sanitizers by setting ECM_ENABLE_SANITIZERS if(ENABLE_SANITIZERS) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -2,8 +2,6 @@ project(bitcoin-test) -option(TEST_WITH_UPGRADE_ACTIVATED "Run unit tests with the next upgrade activated in addition to regular tests" OFF) - # Process json files. file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/data") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -47,19 +47,33 @@ make_link(util/bitcoin-util-test.py) make_link(util/rpcauth-test.py) -add_custom_target(check-functional - COMMENT "Run functional tests..." - COMMAND - "${PYTHON_EXECUTABLE}" - ./functional/test_runner.py - DEPENDS - ../src/bitcoind - ../src/bitcoin-cli - ${CMAKE_CURRENT_BINARY_DIR}/functional/test_runner.py - USES_TERMINAL +macro(add_functional_test_check TARGET COMMENT) + add_custom_target(${TARGET} + COMMENT "${COMMENT}" + COMMAND + "${PYTHON_EXECUTABLE}" + ./functional/test_runner.py + ${ARGN} + DEPENDS + ../src/bitcoind + ../src/bitcoin-cli + ${CMAKE_CURRENT_BINARY_DIR}/functional/test_runner.py + USES_TERMINAL + ) + + add_dependencies(check-all ${TARGET}) +endmacro() + +add_functional_test_check(check-functional + "Run the functional tests" ) -add_dependencies(check-all check-functional) +if(TEST_WITH_UPGRADE_ACTIVATED) + add_functional_test_check(check-functional-upgrade-activated + "Run the functional tests with the upgrade activated" + --with-phononactivation + ) +endif() if(BUILD_BITCOIN_TX) add_custom_target(check-bitcoin-util