You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.8 KiB
41 lines
1.8 KiB
set(CTEST_SITE "test-site")
|
|
set(CTEST_BUILD_NAME "test-build-name")
|
|
set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
|
|
set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
|
|
set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
|
|
set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
|
|
set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
|
|
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
|
|
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
|
|
|
|
if("@CASE_NAME@" MATCHES "^dynamic-resource-")
|
|
set(config_options
|
|
"-DCTEST_DYNAMIC_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/dynamic-resspec.json"
|
|
)
|
|
else()
|
|
set(config_options
|
|
"-DCTEST_RESOURCE_ALLOC_ENABLED=${CTEST_RESOURCE_ALLOC_ENABLED};-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}"
|
|
)
|
|
endif()
|
|
|
|
if(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "CMDLINE")
|
|
list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json")
|
|
elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "ARG")
|
|
set(resspec RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json")
|
|
set(CTEST_RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/noexist.json")
|
|
list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json")
|
|
elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "VARIABLE")
|
|
set(CTEST_RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json")
|
|
list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json")
|
|
elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "CACHE")
|
|
list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/resspec.json")
|
|
endif()
|
|
|
|
ctest_start(Experimental QUIET)
|
|
ctest_configure(OPTIONS "${config_options}")
|
|
ctest_build()
|
|
ctest_test(${resspec} RETURN_VALUE retval PARALLEL_LEVEL ${CTEST_PARALLEL} SCHEDULE_RANDOM ${CTEST_RANDOM})
|
|
if(retval)
|
|
message(FATAL_ERROR "Tests did not pass")
|
|
endif()
|