2013-03-20 15:40:13 +08:00
|
|
|
|
|
|
|
set(CTEST_SOURCE_DIRECTORY "@CMAKE_SOURCE_DIR@")
|
|
|
|
set(CTEST_BINARY_DIRECTORY "@CMAKE_BINARY_DIR@")
|
|
|
|
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
|
|
|
|
set(CTEST_BUILD_NAME "@BUILDNAME@")
|
|
|
|
set(CTEST_SITE "@SITE@")
|
|
|
|
|
|
|
|
set(MODEL Experimental)
|
|
|
|
if(${CTEST_SCRIPT_ARG} MATCHES Nightly)
|
|
|
|
set(MODEL Nightly)
|
2013-03-26 18:52:43 +08:00
|
|
|
elseif(${CTEST_SCRIPT_ARG} MATCHES Continuous)
|
2013-03-20 15:40:13 +08:00
|
|
|
set(MODEL Continuous)
|
|
|
|
endif()
|
|
|
|
|
2019-12-04 18:24:06 +08:00
|
|
|
find_program(CTEST_GIT_COMMAND NAMES git)
|
|
|
|
set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
|
2013-03-20 15:40:13 +08:00
|
|
|
|
|
|
|
ctest_start(${MODEL} ${CTEST_SOURCE_DIRECTORY} ${CTEST_BINARY_DIRECTORY})
|
|
|
|
|
|
|
|
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}")
|
|
|
|
ctest_submit(PARTS Update Notes)
|
|
|
|
|
|
|
|
# to get CTEST_PROJECT_SUBPROJECTS definition:
|
|
|
|
include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake")
|
|
|
|
|
|
|
|
foreach(subproject ${CTEST_PROJECT_SUBPROJECTS})
|
|
|
|
message("")
|
|
|
|
message("Process ${subproject}")
|
|
|
|
|
|
|
|
set_property(GLOBAL PROPERTY SubProject ${subproject})
|
|
|
|
set_property(GLOBAL PROPERTY Label ${subproject})
|
|
|
|
|
|
|
|
ctest_configure(BUILD ${CTEST_BINARY_DIRECTORY} SOURCE ${CTEST_SOURCE_DIRECTORY} )
|
|
|
|
ctest_submit(PARTS Configure)
|
|
|
|
|
|
|
|
set(CTEST_BUILD_TARGET "Build${subproject}")
|
|
|
|
message("Build ${CTEST_BUILD_TARGET}")
|
|
|
|
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
|
|
|
|
# builds target ${CTEST_BUILD_TARGET}
|
|
|
|
ctest_submit(PARTS Build)
|
|
|
|
|
|
|
|
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "${subproject}" )
|
|
|
|
# runs only tests that have a LABELS property matching "${subproject}"
|
|
|
|
|
|
|
|
ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}" LABELS "${subproject}" )
|
|
|
|
|
|
|
|
ctest_submit(PARTS Test)
|
|
|
|
|
|
|
|
endforeach()
|