| 1 |
# @HEADER |
| 2 |
# ***************************************************************************** |
| 3 |
# TriBITS: Tribal Build, Integrate, and Test System |
| 4 |
# |
| 5 |
# Copyright 2013-2016 NTESS and the TriBITS contributors. |
| 6 |
# SPDX-License-Identifier: BSD-3-Clause |
| 7 |
# ***************************************************************************** |
| 8 |
# @HEADER |
| 9 |
|
| 10 |
# |
| 11 |
# CTest script that is used to do an experimental build/test right from a |
| 12 |
# developer's own build directory. |
| 13 |
# |
| 14 |
# To run this script: |
| 15 |
# |
| 16 |
# 1) First configure your directory without enabling any packages (to set the |
| 17 |
# platform-specific and site-specific options). The CMakeCache.txt file that |
| 18 |
# is created will then be modified by the script as packages are enabled and |
| 19 |
# disabled. NOTE: For the safest results, start with an empty build directory |
| 20 |
# (except for your configure script of course). This seems to be needed when |
| 21 |
# switching back and forth between an 'Experimental' and 'Nightly' build for |
| 22 |
# instance. |
| 23 |
# |
| 24 |
# 2) Run the script (overriding any appropriate options) as: |
| 25 |
# |
| 26 |
# env ${PROJECT_NAME}_PACKAGES="<PACKAGES>" \ |
| 27 |
# ctest -S ${PROJECT_NAME}_TRIBITS_DIR/ctest/experimental_build_test.cmake -VV |
| 28 |
# |
| 29 |
# where PACKAGES is the semi-colon-separated list of packages being tested |
| 30 |
# (e.g. ${PROJECT_NAME}_PACKAGES="Teuchos;Epetra;NOX") and |
| 31 |
# ${PROJECT_NAME}_TRIBITS_DIR points back to your home project directory. You |
| 32 |
# can take off the -VV argument if you don't want this to be too verbose. |
| 33 |
# |
| 34 |
# There are a number of other options that you can change as |
| 35 |
# environment variables. See the macros set_default_and_from_env(...) |
| 36 |
# in the file TribitsCTestDriverCore.cmake. One option that you |
| 37 |
# might want to override, for instance is CTEST_BUILD_NAME so that |
| 38 |
# you can insert a special name into the dashboard. |
| 39 |
# |
| 40 |
# When this script finishes running, the last package listed in |
| 41 |
# ${PROJECT_NAME}_PACAKGES will be enabled in the CMakeCache.txt file. |
| 42 |
# |
| 43 |
# NOTE: It is better to use the CMake-built make target 'dashboard' to run |
| 44 |
# this script as it takes care of the details of manipulating the cache and |
| 45 |
# restoring the package enables when it is done. |
| 46 |
# |
| 47 |
|
| 48 |
# |
| 49 |
# General setup code: |
| 50 |
# |
| 51 |
# Do not modify any of this directly, use use environment variables instead! |
| 52 |
# |
| 53 |
|
| 54 |
# |
| 55 |
# Include some CMake/CTest code files |
| 56 |
# |
| 57 |
|
| 58 |
set( CMAKE_MODULE_PATH |
| 59 |
"${CTEST_SCRIPT_DIRECTORY}" |
| 60 |
"${CTEST_SCRIPT_DIRECTORY}/../utils" |
| 61 |
) |
| 62 |
|
| 63 |
include(TribitsCTestDriverCore) |
| 64 |
include(GetLastDirName) |
| 65 |
include(SetDefaultAndFromEnv) |
| 66 |
|
| 67 |
# |
| 68 |
# Override some configuration variables |
| 69 |
# |
| 70 |
|
| 71 |
# All these can be changed by env vars |
| 72 |
set(CTEST_TEST_TYPE Experimental) |
| 73 |
set(CTEST_UPDATE_VERSION_ONLY TRUE) |
| 74 |
set(${PROJECT_NAME}_WARNINGS_AS_ERRORS_FLAGS "-Werror") |
| 75 |
|
| 76 |
# Don't change these in the env! |
| 77 |
set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY FALSE) |
| 78 |
set(CTEST_GENERATE_DEPS_XML_OUTPUT_FILE TRUE) |
| 79 |
set(CTEST_SUBMIT_CDASH_SUBPROJECTS_DEPS_FILE FALSE) |
| 80 |
set(CTEST_WIPE_CACHE FALSE) |
| 81 |
|
| 82 |
# This script should be in PROJECT_BASE/cmake/tribits/ctest |
| 83 |
set_default_and_from_env(PROJECT_SOURCE_DIR "${CTEST_SCRIPT_DIRECTORY}/../../..") |
| 84 |
set(CTEST_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}") |
| 85 |
|
| 86 |
get_filename_component(PWD . REALPATH) |
| 87 |
set(CTEST_BINARY_DIRECTORY "${PWD}") |
| 88 |
set(CTEST_NOTES_FILES "${CTEST_BINARY_DIRECTORY}/do-configure") |
| 89 |
|
| 90 |
get_last_dir_name("${CTEST_BINARY_DIRECTORY}" BUILD_DIR_NAME) |
| 91 |
|
| 92 |
# Can be overridden by the environment |
| 93 |
set( CTEST_BUILD_NAME "${HOST_TYPE}-${BUILD_DIR_NAME}" ) |
| 94 |
set( CTEST_EXPLICITLY_ENABLE_IMPLICITLY_ENABLED_PACKAGES OFF ) |
| 95 |
|
| 96 |
# |
| 97 |
# Run the build/test/submit driver |
| 98 |
# |
| 99 |
|
| 100 |
tribits_ctest_driver() |