1 # - Configure a project for testing with CTest or old Dart Tcl Client
2 # This file is the backwards-compatibility version of the CTest module.
3 # It supports using the old Dart 1 Tcl client for driving dashboard
4 # submissions as well as testing with CTest. This module should be included
5 # in the CMakeLists.txt file at the top of a project. Typical usage:
8 # # ... testing related CMake code ...
10 # The BUILD_TESTING option is created by the Dart module to determine
11 # whether testing support should be enabled. The default is ON.
13 # This file configures a project to use the Dart testing/dashboard process.
14 # It is broken into 3 sections.
16 # Section #1: Locate programs on the client and determine site and build name
17 # Section #2: Configure or copy Tcl scripts from the source tree to build tree
18 # Section #3: Custom targets for performing dashboard builds.
21 OPTION(BUILD_TESTING "Build the testing tree." ON)
24 FIND_PACKAGE(Dart QUIET)
29 # CMake commands that will not vary from project to project. Locates programs
30 # on the client and configure site name and build name.
37 FIND_PROGRAM(COMPRESSIONCOMMAND NAMES gzip compress zip
38 DOC "Path to program used to compress files for transfer to the dart server")
39 FIND_PROGRAM(GUNZIPCOMMAND gunzip DOC "Path to gunzip executable")
40 FIND_PROGRAM(JAVACOMMAND java DOC "Path to java command, used by the Dart server to create html.")
41 OPTION(DART_VERBOSE_BUILD "Show the actual output of the build, or if off show a . for each 1024 bytes."
43 OPTION(DART_BUILD_ERROR_REPORT_LIMIT "Limit of reported errors, -1 reports all." -1 )
44 OPTION(DART_BUILD_WARNING_REPORT_LIMIT "Limit of reported warnings, -1 reports all." -1 )
46 SET(VERBOSE_BUILD ${DART_VERBOSE_BUILD})
47 SET(BUILD_ERROR_REPORT_LIMIT ${DART_BUILD_ERROR_REPORT_LIMIT})
48 SET(BUILD_WARNING_REPORT_LIMIT ${DART_BUILD_WARNING_REPORT_LIMIT})
49 SET (DELIVER_CONTINUOUS_EMAIL "Off" CACHE BOOL "Should Dart server send email when build errors are found in Continuous builds?")
53 DART_BUILD_ERROR_REPORT_LIMIT
54 DART_BUILD_WARNING_REPORT_LIMIT
57 DELIVER_CONTINUOUS_EMAIL
63 IF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
65 ENDIF(EXISTS "${DART_ROOT}/Source/Client/Dart.conf.in")
70 # Make necessary directories and configure testing scripts
72 # find a tcl shell command
78 IF (HAVE_DART AND TCL_TCLSH)
79 # make directories in the binary tree
80 FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Dashboard"
81 "${PROJECT_BINARY_DIR}/Testing/HTML/TestingResults/Sites/${SITE}/${BUILDNAME}")
85 "${DART_ROOT}/Source/Client/Dart.conf.in"
86 "${PROJECT_BINARY_DIR}/DartConfiguration.tcl" )
91 # Custom targets to perform dashboard builds and submissions.
92 # These should NOT need to be modified from project to project.
96 SET(DART_EXPERIMENTAL_NAME Experimental)
97 IF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
98 SET(DART_EXPERIMENTAL_NAME "${DART_EXPERIMENTAL_NAME}${PROJECT_NAME}")
99 ENDIF(DART_EXPERIMENTAL_USE_PROJECT_NAME)
100 ADD_CUSTOM_TARGET(${DART_EXPERIMENTAL_NAME}
101 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update Configure Build Test)
102 ADD_CUSTOM_TARGET(${DART_EXPERIMENTAL_NAME}Submit
103 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Submit)
105 # for non IDE based builds nmake and make
106 # add all these extra targets
107 IF(${CMAKE_MAKE_PROGRAM} MATCHES make)
108 # Make targets for Experimental builds
109 ADD_CUSTOM_TARGET(ExperimentalStart
110 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start)
111 ADD_CUSTOM_TARGET(ExperimentalUpdate
112 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Update)
113 ADD_CUSTOM_TARGET(ExperimentalConfigure
114 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Configure)
115 ADD_CUSTOM_TARGET(ExperimentalBuild
116 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Start Build)
117 ADD_CUSTOM_TARGET(ExperimentalTest
118 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Test)
119 ADD_CUSTOM_TARGET(ExperimentalCoverage
120 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental Coverage)
121 ADD_CUSTOM_TARGET(ExperimentalDashboardStart
122 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardStart)
123 ADD_CUSTOM_TARGET(ExperimentalDashboardEnd
124 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Experimental DashboardEnd)
127 ADD_CUSTOM_TARGET(Continuous
128 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start Update Configure Build Test Submit)
129 ADD_CUSTOM_TARGET(ContinuousStart
130 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Start)
131 ADD_CUSTOM_TARGET(ContinuousUpdate
132 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Update)
133 ADD_CUSTOM_TARGET(ContinuousConfigure
134 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Configure)
135 ADD_CUSTOM_TARGET(ContinuousBuild
136 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Build)
137 ADD_CUSTOM_TARGET(ContinuousTest
138 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Test)
139 ADD_CUSTOM_TARGET(ContinuousCoverage
140 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Coverage)
141 ADD_CUSTOM_TARGET(ContinuousSubmit
142 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Continuous Submit)
145 ADD_CUSTOM_TARGET(Nightly
146 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start Update Configure Build Test Submit)
147 ADD_CUSTOM_TARGET(NightlyStart
148 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Start)
149 ADD_CUSTOM_TARGET(NightlyUpdate
150 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Update)
151 ADD_CUSTOM_TARGET(NightlyConfigure
152 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Configure)
153 ADD_CUSTOM_TARGET(NightlyBuild
154 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Build)
155 ADD_CUSTOM_TARGET(NightlyTest
156 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Test)
157 ADD_CUSTOM_TARGET(NightlyCoverage
158 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Coverage)
159 ADD_CUSTOM_TARGET(NightlySubmit
160 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly Submit)
161 ADD_CUSTOM_TARGET(NightlyDashboardStart
162 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardStart)
163 ADD_CUSTOM_TARGET(NightlyDashboardEnd
164 ${TCL_TCLSH} ${DART_ROOT}/Source/Client/DashboardManager.tcl ${PROJECT_BINARY_DIR}/DartConfiguration.tcl Nightly DashboardEnd)
165 ENDIF (${CMAKE_MAKE_PROGRAM} MATCHES make)
167 ELSE(HAVE_DART AND TCL_TCLSH)
168 SET(RUN_FROM_CTEST_OR_DART 1)
169 INCLUDE(CTestTargets)
170 SET(RUN_FROM_CTEST_OR_DART)
171 ENDIF (HAVE_DART AND TCL_TCLSH)