1 # ============================================================================ 2 # Copyright (c) 2011-2012 University of Pennsylvania 3 # Copyright (c) 2013-2016 Andreas Schuh 6 # See COPYING file for license information or visit 7 # https://cmake-basis.github.io/download.html#license 8 # ============================================================================ 10 ############################################################################## 11 # @file basistest.ctest 12 # @brief CTest script used to test BASIS projects. 14 # To display the help of this CTest script, run: 16 # ctest -S basistest.ctest,help 20 ############################################################################## 23 cmake_policy(SET CMP0007 NEW)
26 cmake_policy(SET CMP0009 NEW)
29 # ============================================================================ 30 # constants - define at first 31 # ============================================================================ 33 # names of options whose name will be added to CTEST_TEST_OPTIONS 34 # instead of CTEST_CMAKE_OPTIONS 35 set (KNOWN_CTEST_TEST_OPTIONS
46 # start time of Nightly test model
48 # All Nightly tests
which are executed within a time window of 24 hours
49 # starting at the specified start time, will replace previous submissions
50 # made within the same time frame such that
for each time frame of 24 hours
51 # only one result of test executions
is present on the dashboard.
52 # The execution of the Nightly tests
is usually triggered automatically
53 # via a scheduled cron job that
is run once every 24 hours.
55 # Use the Continuous or Experimental test models
if you want to
execute 59 # ============================================================================ 61 # ============================================================================ 63 # ---------------------------------------------------------------------------- 64 ## @brief Print usage section of usage information and help screen. 66 # @param [in] ARGN Not used. 72 ctest [ctest options] -S basistest.ctest[,option[=value]]* 74 Note: No commas or equality signs are allowed inside of option values even 75 if the value is enclosed by quotation marks.")
78 # ---------------------------------------------------------------------------- 79 ## @brief Print options section of usage information and help screen. 81 # @param [in] ARGN Not used. 87 " <variable>=<value> Passes -D<variable>=<value> on to CMake for the 88 configuration of the build tree if the variable 89 name is not named in the following. 91 The values of the following variables are passed on 92 to the proper CTest scripting commands:")
93 foreach (V IN LISTS KNOWN_CTEST_TEST_OPTIONS)
97 project=<project> Name of the BASIS project to test. If not given, this
98 script skips the update step. In this case, the srcdir
99 and
bindir options have to be given, or the current
100 working directory must be the root of an already
101 configured build tree.
102 basedir=<path> Base path of both source and binary directory.
103 Default: \"${HOME}/comp_space/testing\
". 104 srcdir=<path> Source directory. This option is required if this script 105 is executed in a build directory which has not been 106 configured yet and if the project option was not specified. 107 If it is run in the root directory of an already configured 108 build tree, however, the value of this option is read from 109 the CMakeCache.txt file. Otherwise, if the project option 110 was specified, it is set to 111 \"<basedir>/<model>/<project>-source/<branch>/\". 112 bindir=<path> Binary directory (i.e., root of build tree). 113 This option defaults to the current working directory 114 if the project option was not specified. Otherwise, 116 \"<basedir>/<model>/<site>/<project>-build/<branch>/\". 117 url=<url> Base URL of the project's SVN repository. 118 Only used if the project option was specified. 119 Default: \"https://sbia-svn.uphs.upenn.edu/projects/<project>\". 120 branch=<name> Name of the SVN branch to test, e.g., \"tags/1.0.0\". 122 model=<model> Name of the dashboard model, i.e., one of 123 \"Nightly\", \"Continuous\", and \"Experimental\". 124 Default: \"Experimental\". 125 memcheck Perform memory check. Requires valgrind. 126 No memory checks are performed by default. 127 coverage Perform coverage analysis. Requires gcov. 128 No coverage analysis is performed by default. 129 install Perform installation after successful test execution. 130 Set CMAKE_INSTALL_PREFIX to change the default installation 131 prefix used by the project (or CMake). Moreover, the 132 DESTDIR environment variable can be set to change the 133 root directory used for installations. 134 Note: Currently this script just executes \"make install\", 135 i.e., it only works with the CMake Makefile generator. 136 apidoc[=<path>] If specified, the API documentation is build 137 and the built HTML documentation copied to the 138 specified directory if the install option is given as well. 139 If this option is given without argument, the default 140 installation directory is used. 141 nosubmit Do not submit test results to the dashboard. 142 shared-source Specify that each test site should use the same copy of 143 the sources. By default, each test site uses its own copy. 144 shared-build Specify that each test site should use the same binary 145 directories. By default, each test site uses its own copy. 146 common-site=<prefix> Do not distinguish between different sites with a common 147 prefix in the name. Useful when the test jobs are executed 148 on a commonly configured cluster. 149 drop-site=<hostname> CTest drop site, i.e., hostname of CDash server. 150 site=<site> Use given site name no matter on which actual machine 151 the test is executed. 152 force-build Force build even if no files were updated. 153 force-test Force test even if no files were updated. 154 force Alias for options force-build, and force-test. 155 tmpbin Delete binary directory on completion (also if not successful). 156 help Prints help and exits without performing any test. 157 helpshort Prints short help and exits without performing any test. 158 helpoptions Prints help on options and exists without performing any test. 159 version Prints version information and exits.")
162 # ---------------------------------------------------------------------------- 163 ## @brief Print contact section of usage information and help screen. 165 # @param [in] ARGN Not used. 172 CMake BASIS Team <https://cmake-basis.github.io/help.html>")
175 # ---------------------------------------------------------------------------- 176 ## @brief Print help screen. 178 # @param [in] ARGN Not used. 186 This CTest script is used at SBIA for nightly testing of software projects. 187 Nightly tests are scheduled by a cron job, for example, every night once. 188 Contrary to continous testing, does the nightly testing job not loop for 189 a certain time of iterations and look for changes actively. The nightly 190 testing job will only perform one test run and then exit. 192 Note: Due to a bug in CTest 2.8.2, the first test will fail because of 193 a missing CTestConfig.cmake file if the source tree is not checked 194 out already. Therefore, the use of CTest 2.8.4 is recommened. 197 By default, the dashboard models \"Nightly\", \"Continuous\", and \"Experimental\" 198 are configured as follows. These default configurations can be modified by 199 supplying the available options listed below. 201 Nightly Performs all test stages even if the project has not been 202 updated since the last test run. 203 Continuous Performs an update of the project's working copy and 204 exits without submission of any test results if no files 205 were updated. Otherwise, it performs all test stages. 206 Experimental Performs all test stages even if the project has not been 207 updated since the last test run. 209 Attention: For each model, only one test process may be running for each 210 project on each site at one time. 212 Build configurations: 213 By default, the Release configuration is used. If the coverage option is 214 given, the Coverage configuration is used. If the memcheck option is given 215 instead, the MemCheck configuration is used. If both coverage and memcheck 216 options are given, the Coverage configuration is chosen because it generally 217 can also be used to perform memory checks, while the reported line numbers 218 may be incorrect in this case, however. Use the CMAKE_BUILD_TYPE variable 219 to explicitly specify a build configuration.")
225 ctest -V -S basistest.ctest 227 Run this command in the root directory of an already configured build tree 228 to test this project. 230 ctest -V -S basistest.ctest,coverage 232 Run this command in the root directory of an already configured build tree 233 to test this project and include coverage analysis results in the test report. 235 ctest -V -S basistest.ctest,project=BASIS,model=Experimental,coverage,memcheck 237 Performs an experimental nightly test of the main development branch of 238 BASIS itself, including coverage analysis and memory checks. 239 The -V option of ctest enables more verbose output of CTest. 240 Even more verbose output can be requested using -VV.")
244 # ---------------------------------------------------------------------------- 245 ## @brief Print usage information. 247 # @param [in] ARGN Not used. 259 # ---------------------------------------------------------------------------- 260 ## @brief Print version information. 262 # @param [in] ARGN Not used. 267 set (VERSION_INFO
"version 3.3.1")
268 if (71f5085 GREATER 0) # project revision > 0
269 set (VERSION_INFO
"${VERSION_INFO} (revision 71f5085)")
271 message (
"CTest script basistest.ctest (BASIS) ${VERSION_INFO}")
272 message (
"Copyright (c) 2011 University of Pennsylvania. All rights reserved.")
273 message (
"See COPYING file or https://www.rad.upenn.edu/sbia/software/license.html.")
276 # ============================================================================ 278 # ============================================================================ 280 # ---------------------------------------------------------------------------- 281 ## @brief Read value from CMake cache. 283 # @param [in, out] VAR Name of CMake variable. 284 # @param [in] ARGN Not used. 286 # @returns Sets @p VAR to the value of the cached variable @p VAR. 288 file (STRINGS
"${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" ENTRY REGEX
"${VAR}:.*=(.*)")
289 string (REGEX REPLACE
"${VAR}:.*=(.*)" "\\1" VALUE "${ENTRY}")
290 set (${VAR}
"${VALUE}" PARENT_SCOPE)
293 # ---------------------------------------------------------------------------- 294 ## @brief Adjust information attached to test results using CMakeCache.txt. 296 # @param [in] ARGN List of XML test report files without directory path. 297 # If omitted, this function globs for all XML files in 298 # the <tt>Testing/<tag>/</tt> directory. 300 #
get compiler information from CMake cache
301 if (EXISTS
"${CTEST_BINARY_DIRECTORY}/CMakeCache.txt")
303 set (NAME_COMPONENT
"NAME_WE")
305 set (NAME_COMPONENT
"NAME")
309 set (COMPILER
"${CMAKE_CXX_COMPILER}")
313 set (COMPILER
"${CMAKE_BUILD_TOOL}")
316 if (COMPILER_NAME MATCHES
"msdev")
317 set (COMPILER_NAME
"vs60")
318 elseif (COMPILER_NAME MATCHES
"devenv")
320 string (REGEX REPLACE
"Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER
"${CMAKE_GENERATOR}")
321 if (
"${CMAKE_GENERATOR}" MATCHES
"Visual Studio 7 .NET 2003")
322 set (COMPILER_NAME
"vs71")
324 set (COMPILER_NAME
"vs${NUMBER}")
328 set (COMPILER
"unknown")
329 set (COMPILER_NAME
"unknown")
331 # replace COMPILER_NAME in build name 332 string (CONFIGURE
"${CTEST_BUILD_NAME}" BUILDNAME @ONLY)
333 message (
"Change build name to ${BUILDNAME}")
334 # get tag, i.e., subdirectory name required by update_metadata() 335 if (EXISTS
"${CTEST_BINARY_DIRECTORY}/Testing/TAG")
336 file (STRINGS
"${CTEST_BINARY_DIRECTORY}/Testing/TAG" TAG LIMIT_COUNT 1)
340 # modify submission files 346 "${CTEST_BINARY_DIRECTORY}/Testing/${TAG}" 347 "${CTEST_BINARY_DIRECTORY}/Testing/${TAG}/*.xml" 350 foreach (SUBMISSION_FILE IN LISTS ARGV)
351 set (SUBMISSION_FILE
"${CTEST_BINARY_DIRECTORY}/Testing/${TAG}/${SUBMISSION_FILE}")
352 # read submission file
353 file (READ
"${SUBMISSION_FILE}" XML)
354 # set compiler name if necessary 355 string (REPLACE
"CompilerName=\"\"" "CompilerName=\"${COMPILER}\"" XML
"${XML}")
356 string (REPLACE
"<CompilerName></CompilerName>" "<CompilerName>${COMPILER}</CompilerName>" XML
"${XML}")
357 # replace intermediate build name 358 string (REPLACE
"BuildName=\"\"" "BuildName=\"${BUILDNAME}\"" XML
"${XML}")
359 string (REPLACE
"<BuildName></BuildName>" "<BuildName>${BUILDNAME}</BuildName>" XML
"${XML}")
360 string (REPLACE
"BuildName=\"${CTEST_BUILD_NAME}\"" "BuildName=\"${BUILDNAME}\"" XML
"${XML}")
361 string (REPLACE
"<BuildName>${CTEST_BUILD_NAME}</BuildName>" "<BuildName>${BUILDNAME}</BuildName>" XML
"${XML}")
362 # write modified submission file 363 file (WRITE
"${SUBMISSION_FILE}" "${XML}")
367 # ============================================================================ 369 # ============================================================================ 371 set (
MANUAL_MODE FALSE) # whether
this script
is running in manual mode, i.e.,
372 # executed in the build tree of an existing project
373 # instead of run by a cron job
375 # ----------------------------------------------------------------------------
384 set (COMMON_SITE_PREFIXES)
386 set (CTEST_EXTRA_SUBMIT_FILES) # additional files
for submission to the dashboard
388 # ---------------------------------------------------------------------------- 391 set (CTEST_SVN_URL
"https://sbia-svn.uphs.upenn.edu/projects/\@CTEST_PROJECT_NAME\@")
394 # ----------------------------------------------------------------------------
395 # build configuration
401 set (
WITH_APIDOC FALSE) # enable/disable build of API documentation
406 # ---------------------------------------------------------------------------- 408 set (CTEST_TEST_OPTIONS)
413 # ----------------------------------------------------------------------------
414 # installation directories
416 # install project files after successful test execution
418 # output directory for built Doxygen documentation 419 set (INSTALL_APIDOC_DIR)
421 # ============================================================================
423 # ============================================================================
428 set (${VAR}
"${VALUE}")
436 set (${VAR}
"${ARGN}")
443 list (APPEND ${VAR}
"${VALUE}")
449 string (REPLACE
"," ";" ARGV
"${CTEST_SCRIPT_ARG}")
450 foreach (ARG ${ARGV})
455 string (REPLACE
"=" ";" PARTS
"${ARG}")
456 list (LENGTH PARTS LEN)
462 list (GET PARTS 1 VALUE)
468 elseif (${
OPTION} STREQUAL
"model")
470 elseif (${
OPTION} STREQUAL
"basedir")
472 elseif (${
OPTION} STREQUAL
"srcdir")
474 elseif (${
OPTION} STREQUAL
"bindir")
476 elseif (${
OPTION} STREQUAL
"url")
478 elseif (${
OPTION} STREQUAL
"branch")
480 elseif (${
OPTION} STREQUAL
"memcheck")
482 elseif (${
OPTION} STREQUAL
"coverage")
484 elseif (${
OPTION} STREQUAL
"tmpbin")
486 elseif (${
OPTION} STREQUAL
"install")
488 elseif (${
OPTION} STREQUAL
"apidoc")
493 elseif (${
OPTION} STREQUAL
"shared-source")
495 elseif (${
OPTION} STREQUAL
"shared-build")
497 elseif (${
OPTION} STREQUAL
"submit")
499 elseif (${
OPTION} STREQUAL
"nosubmit")
501 elseif (${
OPTION} STREQUAL
"common-site")
503 elseif (${
OPTION} STREQUAL
"site")
505 elseif (${
OPTION} STREQUAL
"force")
508 elseif (${
OPTION} STREQUAL
"force-build")
510 elseif (${
OPTION} STREQUAL
"force-test")
512 elseif (${
OPTION} STREQUAL
"version")
515 elseif (${
OPTION} STREQUAL
"help")
518 elseif (${
OPTION} STREQUAL
"helpshort")
521 elseif (${
OPTION} STREQUAL
"helpoptions")
528 string (TOUPPER
"${OPTION}" OPTION_UPPER)
529 list (FIND KNOWN_CTEST_TEST_OPTIONS
"${OPTION_UPPER}" IDX)
531 if (
OPTION MATCHES
"^CMAKE_BUILD_TYPE$")
537 list (APPEND CTEST_TEST_OPTIONS
"${OPTION_UPPER}" "${VALUE}")
546 message (FATAL_ERROR "Invalid options: ${CTEST_SCRIPT_ARG}
547 Failed to parse argument \
"${ARG}\" (option: ${OPTION}, value: ${VALUE})")
553 # automatically
set binary directory
if not specified
556 find_program (PWD pwd)
558 find_program (PWD cd)
564 OUTPUT_STRIP_TRAILING_WHITESPACE
567 set (CTEST_BINARY_DIRECTORY
"${CWD}")
569 message (FATAL_ERROR
"Failed to get current working directory! Try using the bindir option instead.")
572 # set project name from CMake cache 573 if (EXISTS
"${CTEST_BINARY_DIRECTORY}/CMakeCache.txt")
575 if (NOT CMAKE_PROJECT_NAME)
576 message (FATAL_ERROR
"Failed to read project name from ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt!")
578 set (CTEST_PROJECT_NAME
"${CMAKE_PROJECT_NAME}")
580 # automatically set source directory if not specified 582 if (NOT EXISTS
"${CTEST_BINARY_DIRECTORY}/CMakeCache.txt")
583 message (FATAL_ERROR
"Missing CMakeCache.txt file! Either specify source directory using the srcdir option or initialize the build tree.")
586 if (NOT ${CTEST_PROJECT_NAME}_SOURCE_DIR)
587 message (FATAL_ERROR
"Failed to read source directory from ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt!")
589 set (CTEST_SOURCE_DIRECTORY
"${${CTEST_PROJECT_NAME}_SOURCE_DIR}")
593 if (NOT CTEST_BINARY_DIRECTORY)
594 set (CTEST_BINARY_DIRECTORY
"${CTEST_SOURCE_DIRECTORY}")
597 string (TOLOWER
"${CTEST_PROJECT_NAME}" CTEST_PROJECT_NAME_LOWER)
598 string (TOUPPER
"${CTEST_PROJECT_NAME}" CTEST_PROJECT_NAME_UPPER)
605 # ============================================================================ 607 # ============================================================================ 609 # dashboard submission to SBIA CDash server 611 # Note: By default, CTest does not support HTTPS as submission method. 612 # In order to enable it, CTest (and hence CMake) has to be build 613 # manually with the option CMAKE_USE_OPENSSL enabled. 621 # See documentation of CTest.cmake module. 624 # ============================================================================
626 # ============================================================================
628 # ----------------------------------------------------------------------------
632 set (CTEST_BUILD_TYPE
"Debug")
634 set (CTEST_BUILD_TYPE
"Release")
638 # ---------------------------------------------------------------------------- 641 site_name (CTEST_SITE)
643 if (COMMON_SITE_PREFIXES)
644 foreach (P ${COMMON_SITE_PREFIXES})
645 if (CTEST_SITE MATCHES
"^${P}")
646 set (CTEST_SITE
"${P}")
653 # ---------------------------------------------------------------------------- 656 # Note: The pattern in the build name as written to the .xml files 657 # will be replaced by this script before the submission once the used 658 # compiler is known from the CMake cache. 664 elseif (WITH_MEMCHECK)
668 # ---------------------------------------------------------------------------- 676 elseif (WITH_MEMCHECK)
680 if (CTEST_BUILD_TYPE)
686 if (NOT CTEST_SOURCE_DIRECTORY)
693 if (NOT CTEST_BINARY_DIRECTORY) 701 string (REGEX REPLACE "/$
" "" CTEST_BINARY_DIRECTORY "${CTEST_BINARY_DIRECTORY}
") 702 string (REGEX REPLACE "/$
" "" CTEST_SOURCE_DIRECTORY "${CTEST_SOURCE_DIRECTORY}
") 704 string (CONFIGURE "${INSTALL_APIDOC_DIR}
" INSTALL_APIDOC_DIR) 707 set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY FALSE) 709 set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) 712 # ---------------------------------------------------------------------------- 717 HINTS "${CMAKE_CURRENT_LIST_DIR}/../../bin
" 719 find_program (CTEST_SVN_COMMAND NAMES svn) 721 if (NOT CTEST_SVN_COMMAND) 722 message (FATAL_ERROR "Could not find \
"basistest-svn\" or \"svn\" command!")
725 string (CONFIGURE
"${CTEST_SVN_URL}" CTEST_SVN_URL @ONLY)
727 if (NOT MANUAL_MODE AND NOT EXISTS
"${CTEST_SOURCE_DIRECTORY}/.svn")
728 file (MAKE_DIRECTORY
"${CTEST_SOURCE_DIRECTORY}")
# in particular all missing parent directories 729 set (
CTEST_CHECKOUT_COMMAND "${CTEST_SVN_COMMAND} co \"${CTEST_SVN_URL}/${CTEST_SVN_BRANCH}\" ${CTEST_SOURCE_DIRECTORY}")
733 # ----------------------------------------------------------------------------
736 find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
737 if (NOT CTEST_COVERAGE_COMMAND)
738 message (FATAL_ERROR
"Could not find gcov! Only gcc and gcov supported to perform coverage analysis.")
744 # ---------------------------------------------------------------------------- 747 # TODO Consider switching to AddressSanitizer instead, which requires the 748 # use of the clang compiler, however, with the compiler flag 749 # -faddress-sanitizer. 750 find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) 751 if (NOT CTEST_MEMORYCHECK_COMMAND) 752 message (FATAL_ERROR "Could not find valgrind! Only valgrind supported as memory error detector.
") 754 if (NOT WITH_COVERAGE) 758 if (CTEST_MEMORYCHECK_SUPPRESSIONS_FILE) 761 CTEST_MEMORYCHECK_SUPPRESSIONS_FILE 771 # ---------------------------------------------------------------------------- 772 # configuration / build 773 set (CTEST_CONFIGURE_COMMAND "\
"${CMAKE_COMMAND}\"")
774 if (CTEST_BUILD_TYPE)
777 if (CTEST_COMPILER_FLAGS) 780 set (
CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-DCMAKE_CXX_FLAGS:STRING=${CTEST_COMPILER_FLAGS}\"")
784 set (
CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-DCMAKE_EXE_LINKER_FLAGS:STRING=${CTEST_LINKER_FLAGS}\"")
785 set (
CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-DCMAKE_MODULE_LINKER_FLAGS:STRING=${CTEST_LINKER_FLAGS}\"")
786 set (
CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CTEST_LINKER_FLAGS}\"")
790 set (
CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DBUILD_DOCUMENTATION:BOOL=ON -DBASIS_ALL_DOC:BOOL=ON")
791 if (INSTALL_APIDOC_DIR)
792 set (
CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DBASIS_INSTALL_APIDOC_DIR:PATH=${INSTALL_APIDOC_DIR}")
803 # ============================================================================ 805 # ============================================================================ 810 # ---------------------------------------------------------------------------- 811 # in manual mode, preserve CMake cache to be able to restore it later 812 if (MANUAL_MODE AND EXISTS
"${CTEST_BINARY_DIRECTORY}/CMakeCache.txt")
814 COMMAND "${CMAKE_COMMAND}" -E copy
815 "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" 816 "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt.bak" 820 # ---------------------------------------------------------------------------- 821 # empty the binary directory 823 ctest_empty_binary_directory (
"${CTEST_BINARY_DIRECTORY}")
826 # ---------------------------------------------------------------------------- 827 # start a new test run 828 ctest_start (
"${CTEST_MODEL}")
830 # ---------------------------------------------------------------------------- 831 # update working copy 835 ctest_update (RETURN_VALUE NUM_FILES)
845 # perform other test stages and submit results only if required 848 # -------------------------------------------------------------------------- 851 # Note: Also in manual mode to enforce the selected build configuration! 855 ctest_read_custom_files (
"${CTEST_BINARY_DIRECTORY}")
858 # -------------------------------------------------------------------------- 861 ctest_build (NUMBER_ERRORS NUMBER_OF_ERRORS RETURN_VALUE
BUILD_RESULT)
862 if (NUMBER_OF_ERRORS GREATER 0)
867 # -------------------------------------------------------------------------- 868 # perform tests only if required 871 # ------------------------------------------------------------------------ 874 ctest_test (${CTEST_TEST_OPTIONS} RETURN_VALUE TEST_RESULT)
877 # --------------------------------------------------------------------------- 878 # perform installation 880 message (
"Install project files")
881 # First deinstall previously installed files to ensure that obsolete 882 # files are removed. These obsolete files could otherwise be used by 883 # other projects and the test would not reveal that the projects are 884 # actually no longer compatible. 890 WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}
" 891 TIMEOUT 1800 # 30 minutes 892 RESULT_VARIABLE UNINSTALL_RESULT 893 OUTPUT_FILE "${CTEST_BINARY_DIRECTORY}/install.log
" 894 ERROR_FILE "${CTEST_BINARY_DIRECTORY}/install.log
" 898 COMMAND make uninstall 899 WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}
" 900 TIMEOUT 1800 # 30 minutes 901 RESULT_VARIABLE UNINSTALL_RESULT 902 OUTPUT_FILE "${CTEST_BINARY_DIRECTORY}/install.log
" 903 ERROR_FILE "${CTEST_BINARY_DIRECTORY}/install.log
" 909 WORKING_DIRECTORY "${CTEST_BINARY_DIRECTORY}
" 910 TIMEOUT 1800 # 30 minutes 911 RESULT_VARIABLE INSTALL_RESULT 912 OUTPUT_FILE "${CTEST_BINARY_DIRECTORY}/install.log
" 913 ERROR_FILE "${CTEST_BINARY_DIRECTORY}/install.log
" 915 # submit log file in case of errors to dashboard 916 if (NOT UNINSTALL_RESULT EQUAL 0 OR NOT INSTALL_RESULT EQUAL 0) 917 list (APPEND CTEST_NOTES_FILES "${CTEST_BINARY_DIRECTORY}/install.log
") 921 # -------------------------------------------------------------------------- 922 # perform coverage analysis 923 if (WITH_COVERAGE AND CTEST_COVERAGE_COMMAND) 927 # -------------------------------------------------------------------------- 928 # perform memory checks 929 if (WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND) 930 ctest_memcheck (${CTEST_TEST_OPTIONS}) 937 # ----------------------------------------------------------------------------- 938 # adjust test result meta-data - even if these will not be submitted yet 941 # ----------------------------------------------------------------------------- 947 # ----------------------------------------------------------------------------- 950 file (REMOVE_RECURSE "${CTEST_BINARY_DIRECTORY}
") 952 if (MANUAL_MODE AND EXISTS "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt.bak
") 954 COMMAND "${CMAKE_COMMAND}
" -E compare_files 955 "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt
" 956 "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt.bak
" 962 file (REMOVE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt.bak
") 964 message ("Restoring build system configuration...
") 966 RENAME "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt.bak
" 967 "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt
" 970 COMMAND "${CMAKE_COMMAND}
" "${CTEST_BINARY_DIRECTORY}
" 975 message ("Restoring build system configuration... - done
") 977 message ("Restoring build system configuration... - failed
")
std::string bindir()
Get absolute path to directory containing runtime executables.
macro append_option(in VAR, in ARGN)
cmake CTEST_DROP_LOCATION
cmake CTEST_USE_LAUNCHERS
cmake CMAKE_INSTALL_PREFIX
Installation prefix, i.e., root directory of installation.
cmake CTEST_BINARY_DIRECTORY
cmake CTEST_NIGHTLY_START_TIME
function is(in result, in expected, in name)
Test whether a given result is equal to the expected result.
def which(command, path=None, verbose=0, exts=None)
cmake CTEST_COMPILER_FLAGS
cmake CTEST_CMAKE_OPTIONS
function print_options(in ARGN)
Print options section of usage information and help screen.
function print_version(in ARGN)
Print version information.
function print_usage(in ARGN)
Print usage section of usage information and help screen.
function read_cmake_cache_value(inout VAR, in ARGN)
Read value from CMake cache.
cmake CTEST_START_WITH_EMPTY_BINARY_DIRECTORY
function update_metadata(in ARGN)
Adjust information attached to test results using CMakeCache.txt.
cmake CTEST_UPDATE_COMMAND
cmake CTEST_DROP_SITE_CDASH
CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
#define UNIX
Whether the sources are compiled on a Unix-based system.
macro set_option(in VAR, in ARGN)
cmake CTEST_SOURCE_DIRECTORY
cmake CTEST_CHECKOUT_COMMAND
cmake CTEST_CONFIGURE_COMMAND
function print_contact(in ARGN)
Print contact section of usage information and help screen.
function print_helpshort(in ARGN)
Print usage information.
function get_filename_component(inout ARGN)
Fixes CMake's get_filename_component() command.
cmake CTEST_BASE_DIRECTORY
function print_help(in ARGN)
Print help screen.
cmake CTEST_CMAKE_GENERATOR
function execute(in options, in cmd, in args)
Execute command as subprocess.