1 2 set(CTEST_SOURCE_DIRECTORY "@CMAKE_SOURCE_DIR@") 3 set(CTEST_BINARY_DIRECTORY "@CMAKE_BINARY_DIR@") 4 set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") 5 set(CTEST_BUILD_NAME "@BUILDNAME@") 6 set(CTEST_SITE "@SITE@") 7 8 set(MODEL Experimental) 9 if(${CTEST_SCRIPT_ARG} MATCHES Nightly) 10 set(MODEL Nightly) 11 elseif(${CTEST_SCRIPT_ARG} MATCHES Continuous) 12 set(MODEL Continuous) 13 endif() 14 15 find_program(CTEST_HG_COMMAND NAMES hg) 16 set(CTEST_UPDATE_COMMAND "${CTEST_HG_COMMAND}") 17 18 ctest_start(${MODEL} ${CTEST_SOURCE_DIRECTORY} ${CTEST_BINARY_DIRECTORY}) 19 20 ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}") 21 ctest_submit(PARTS Update Notes) 22 23 # to get CTEST_PROJECT_SUBPROJECTS definition: 24 include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake") 25 26 foreach(subproject ${CTEST_PROJECT_SUBPROJECTS}) 27 message("") 28 message("Process ${subproject}") 29 30 set_property(GLOBAL PROPERTY SubProject ${subproject}) 31 set_property(GLOBAL PROPERTY Label ${subproject}) 32 33 ctest_configure(BUILD ${CTEST_BINARY_DIRECTORY} SOURCE ${CTEST_SOURCE_DIRECTORY} ) 34 ctest_submit(PARTS Configure) 35 36 set(CTEST_BUILD_TARGET "Build${subproject}") 37 message("Build ${CTEST_BUILD_TARGET}") 38 ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) 39 # builds target ${CTEST_BUILD_TARGET} 40 ctest_submit(PARTS Build) 41 42 ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "${subproject}" ) 43 # runs only tests that have a LABELS property matching "${subproject}" 44 45 ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}" LABELS "${subproject}" ) 46 47 ctest_submit(PARTS Test) 48 49 endforeach() 50