CTestCustom.cmake
Go to the documentation of this file.
1 # ============================================================================
2 # Copyright (c) 2011-2012 University of Pennsylvania
3 # Copyright (c) 2013-2016 Andreas Schuh
4 # All rights reserved.
5 #
6 # See COPYING file for license information or visit
7 # https://cmake-basis.github.io/download.html#license
8 # ============================================================================
9 
10 ##############################################################################
11 # @file CTestCustom.cmake
12 # @brief Custom testing configuration.
13 #
14 # @note The CTestCustom.cmake file is automatically generated by BASIS from
15 # the file CTestCustom.cmake.in which is part of the
16 # BASIS package.
17 #
18 # The custom CTest variables which can be set in this CTest configuration file
19 # are documented on the
20 # <a href="http://www.vtk.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest">
21 # Wiki of the VTK project</a>.
22 #
23 # @ingroup BasisSettings
24 ##############################################################################
25 
26 # ============================================================================
27 # disable verification of self-signed CA certificates
28 # ============================================================================
29 
30 ## @brief cURL options for dashboad submissions.
31 #
32 # The following cURL options disable the verification of the CA certificate.
33 # This is required when self-signed certificates are used which cannot be verified.
34 #
35 # The drop method is set in the CTest configuration file CTestConfig.cmake.
36 #
37 # Note: By default, CTest does not support HTTPS as submission method.
38 # In order to enable it, CTest (and hence CMake) has to be build
39 # manually with the option CMAKE_USE_OPENSSL enabled.
40 if (CTEST_DROP_METHOD STREQUAL "https")
41  set (
42  CTEST_CURL_OPTIONS
43  "CURLOPT_SSL_VERIFYPEER_OFF"
44  "CURLOPT_SSL_VERIFYHOST_OFF"
45  )
46 endif ()
47 
48 # ============================================================================
49 # custom CTest settings
50 # ============================================================================
51 
52 # ----------------------------------------------------------------------------
53 # warnings
54 # ----------------------------------------------------------------------------
55 
56 ## @brief Match expressions for warning messages.
57 set (
58  CTEST_CUSTOM_WARNING_MATCH
59  ${CTEST_CUSTOM_WARNING_MATCH} # keep current warning matches
60  "[0-9][0-9]*: WARNING " # add match expressions on separate lines
61  "[0-9][0-9]*: Warning "
62  "[0-9][0-9]*: warning "
63 )
64 
65 ## @brief Match expressions for ignored warning messages.
66 set (
68  ${CTEST_CUSTOM_WARNING_EXCEPTION} # keep current warning exceptions
69 # "Example-1.0" # add exception expressions on separate lines
70 )
71 
72 # specify maximum number of warnings to display
73 #set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "100")
74 
75 # ----------------------------------------------------------------------------
76 # errors
77 # ----------------------------------------------------------------------------
78 
79 ## @brief Match expressions for error messages.
80 set (
81  CTEST_CUSTOM_ERROR_MATCH
82  ${CTEST_CUSTOM_ERROR_MATCH} # keep current error matches
83  "[0-9][0-9]*: ERROR " # add match expressions on separate lines
84  "[0-9][0-9]*: Error "
85  "[0-9][0-9]*: error "
86  "No tests were found!!!" # CTest error if their are no tests
87 )
88 
89 ## @brief Match expressions for ignored error messages.
90 set (
91  CTEST_CUSTOM_ERROR_EXCEPTION
92  ${CTEST_CUSTOM_ERROR_EXCEPTION} # keep current error exceptions
93 # "ExampleExec-1.0" # add exception expressions on separate lines
94 )
95 
96 # specify maximum number of errors to display
97 #set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "100")
98 
99 # ----------------------------------------------------------------------------
100 # test
101 # ----------------------------------------------------------------------------
102 
103 ## @brief Specify tests which should be ignored during the test stage.
104 set (
105  CTEST_CUSTOM_TESTS_IGNORE
106  ${CTEST_CUSTOM_TESTS_IGNORE}
107  ""
108 )
109 
110 ## @brief Specify command to execute before execution of any test during test stage.
111 set (
112  CTEST_CUSTOM_PRE_TEST
113  ${CTEST_CUSTOM_PRE_TEST}
114  ""
115 )
116 
117 ## @brief Specify command to execute at the end of the test stage.
118 set (
119  CTEST_CUSTOM_POST_TEST
120  ${CTEST_CUSTOM_POST_TEST}
121  ""
122 )
123 
124 # ----------------------------------------------------------------------------
125 # coverage
126 # ----------------------------------------------------------------------------
127 
128 
129 # get relative paths for use in globbing expression
130 #
131 # Note that all public include files are copied to the build tree and thus
132 # consider only the once in the build tree, not the once in the source tree.
133 file (RELATIVE_PATH MODULES_DIR "/Users/as12312/Software/BASIS/Workspace" "/Users/as12312/Software/BASIS/Workspace/modules")
134 file (RELATIVE_PATH CODE_DIR "/Users/as12312/Software/BASIS/Workspace" "/Users/as12312/Software/BASIS/Workspace/src")
135 file (RELATIVE_PATH INCLUDE_DIR "/Users/as12312/Software/BASIS/Xcode" "/Users/as12312/Software/BASIS/Xcode/include")
136 
137 ## @brief Exclude certain files from coverage analysis.
138 set (
139  CTEST_CUSTOM_COVERAGE_EXCLUDE
140  ${CTEST_CUSTOM_COVERAGE_EXCLUDE} # keep current exclude expressions
141  "/CMakeFiles/CMakeTmp/" # exclude try_compile sources
142  "./test/.*" # exclude test implementations
143  "${PROJECT_MODULES_DIR}/.*/test/.*" # exclude test implementations of modules
144  # add further exclude expressions here
145  "/gtest/" # tested by Google
146  "/gmock/" # tested by Google
147  "test.cxx" # tested by Google
148  "test_main.cxx" # tested by Google
149  "/except.h" # only macro definitions
150 )
151 
152 ## @brief Specify additional files which should be considered for coverage report.
153 #
154 # Note that the expressions here are globbing expression as interpreted
155 # by CMake's file(GLOB) command, not regular expressions.
156 set (CTEST_EXTRA_COVERAGE_GLOB ${CTEST_EXTRA_COVERAGE_GLOB})
157 foreach (E IN ITEMS .c .cc .cpp .cxx .h .hh .hpp .hxx .txx .inl .inc)
158  list (APPEND CTEST_EXTRA_COVERAGE_GLOB
159  "${CODE_DIR}/*${E}"
160  )
161 endforeach ()
162 foreach (E IN ITEMS .h .hh .hpp .hxx .txx .inl .inc)
163  list (APPEND CTEST_EXTRA_COVERAGE_GLOB
164  "${INCLUDE_DIR}/*${E}"
165  )
166 endforeach ()
167 foreach (M IN LISTS "")
168  foreach (E IN ITEMS .h .hh .hpp .hxx .txx .inl .inc)
169  list (APPEND CTEST_EXTRA_COVERAGE_GLOB
170  "${MODULES_DIR}/${M}/${INCLUDE_DIR}/*${E}"
171  )
172  endforeach ()
173 endforeach ()
174 
175 # ----------------------------------------------------------------------------
176 # memory check
177 # ----------------------------------------------------------------------------
178 
179 ## @brief Specify tests which should be ignored during the memory check stage.
180 set (
181  CTEST_CUSTOM_MEMCHECK_IGNORE
182  ""
183 )
184 
185 ## @brief Specify command to execute before execution of any test during memory check stage.
186 set (
187  CTEST_CUSTOM_PRE_MEMCHECK
188  ""
189 )
190 
191 ## @brief Specify command to execute at the end of the memory check stage.
192 set (
193  CTEST_CUSTOM_POST_MEMCHECK
194  ""
195 )
196 
197 # ----------------------------------------------------------------------------
198 # output
199 # ----------------------------------------------------------------------------
200 
201 ## @brief Adjust output size limit of failed tests in number of characters/bytes.
202 #
203 # Note: In order to have CTest ignore these limits and not truncate the test
204 # output, the string "CTEST_FULL_OUTPUT" has to be output by the test
205 # (e.g., as first line of the test output to stdout).
206 #
207 # See: http://public.kitware.com/pipermail/cdash/2009-November/000589.html
208 set (CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE "1048576")
209 
210 ## @brief Adjust output size limit of failed tests in number of characters/bytes.
211 #
212 # Note: In order to have CTest ignore these limits and not truncate the test
213 # output, the string "CTEST_FULL_OUTPUT" has to be output by the test
214 # (e.g., as first line of the test output to stdout).
215 #
216 # See: http://public.kitware.com/pipermail/cdash/2009-November/000589.html
217 set (CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE "102400")
def which(command, path=None, verbose=0, exts=None)
Definition: which.py:257
CTEST_CUSTOM_WARNING_EXCEPTION
cURL options for dashboad submissions.
function match(in value, in pattern)
This function implements a more portable way to do pattern matching.
cmake CTEST_DROP_METHOD
function execute(in options, in cmd, in args)
Execute command as subprocess.