blob: 4f290cd2ebe0ed60730d80799731dc25694f3924 [file] [log] [blame]
Martin Hořeňovský50c95a02017-01-31 20:21:03 +01001cmake_minimum_required(VERSION 3.0)
Kostace441a92013-08-05 12:40:33 +02002
Phil Nash0bcae642017-01-09 17:32:57 +00003project(CatchSelfTest)
Kostace441a92013-08-05 12:40:33 +02004
Phil Nash8abe17a2017-01-09 16:27:06 +00005set_property(GLOBAL PROPERTY USE_FOLDERS ON)
6
Kostace441a92013-08-05 12:40:33 +02007# define some folders
Phil Nashc8fefc42017-01-06 16:19:20 +00008set(CATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR})
Kostace441a92013-08-05 12:40:33 +02009set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest)
Martin Hořeňovský3b7511e2017-01-14 21:55:37 +010010set(BENCHMARK_DIR ${CATCH_DIR}/projects/Benchmark)
Phil Nashe1fbbe12017-01-06 16:59:18 +000011set(HEADER_DIR ${CATCH_DIR}/include)
12
Phil Nash073377a2017-04-25 11:06:28 +010013if(USE_CPP14)
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +010014 message(STATUS "Enabling C++14")
15 set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
Phil Nash073377a2017-04-25 11:06:28 +010016else()
17 message(STATUS "Enabling C++11")
18 set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
19
Andy Sawyer13cbdf72014-09-04 00:32:05 +010020endif()
Kostace441a92013-08-05 12:40:33 +020021
Antonio Di Monacob8443e62017-05-11 13:00:03 +020022if(USE_WMAIN)
23 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:wmainCRTStartup")
24endif()
25
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +010026#checks that the given hard-coded list contains all headers + sources in the given folder
27function(CheckFileList LIST_VAR FOLDER)
28 set(MESSAGE " should be added to the variable ${LIST_VAR}")
29 set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
30 file(GLOB GLOBBED_LIST "${FOLDER}/*.cpp"
31 "${FOLDER}/*.hpp"
32 "${FOLDER}/*.h")
33 list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
34 foreach(EXTRA_ITEM ${GLOBBED_LIST})
35 string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
36 message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
37 endforeach()
38endfunction()
39
40function(CheckFileListRec LIST_VAR FOLDER)
41 set(MESSAGE " should be added to the variable ${LIST_VAR}")
42 set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
43 file(GLOB_RECURSE GLOBBED_LIST "${FOLDER}/*.cpp"
44 "${FOLDER}/*.hpp"
45 "${FOLDER}/*.h")
46 list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
47 foreach(EXTRA_ITEM ${GLOBBED_LIST})
48 string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
49 message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
50 endforeach()
51endfunction()
52
Kostace441a92013-08-05 12:40:33 +020053# define the sources of the self test
Phil Nashd5360e82017-01-12 11:54:53 +000054# Please keep these ordered alphabetically
Phil Nash8abe17a2017-01-09 16:27:06 +000055set(TEST_SOURCES
Phil Nash30cebd62016-11-09 22:55:32 +000056 ${SELF_TEST_DIR}/ApproxTests.cpp
57 ${SELF_TEST_DIR}/BDDTests.cpp
58 ${SELF_TEST_DIR}/ClassTests.cpp
Phil Nashd5360e82017-01-12 11:54:53 +000059 ${SELF_TEST_DIR}/CmdLineTests.cpp
Martin Hořeňovský7db4d8d2017-02-07 13:32:48 +010060 ${SELF_TEST_DIR}/CompilationTests.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000061 ${SELF_TEST_DIR}/ConditionTests.cpp
Martin Hořeňovskýea48ae02017-05-27 14:42:05 +020062 ${SELF_TEST_DIR}/DecompositionTests.cpp
Phil Nashd5360e82017-01-12 11:54:53 +000063 ${SELF_TEST_DIR}/EnumToString.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000064 ${SELF_TEST_DIR}/ExceptionTests.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000065 ${SELF_TEST_DIR}/MessageTests.cpp
66 ${SELF_TEST_DIR}/MiscTests.cpp
67 ${SELF_TEST_DIR}/PartTrackerTests.cpp
Phil Nashd5360e82017-01-12 11:54:53 +000068 ${SELF_TEST_DIR}/TagAliasTests.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000069 ${SELF_TEST_DIR}/TestMain.cpp
Martin Hořeňovský7db4d8d2017-02-07 13:32:48 +010070 ${SELF_TEST_DIR}/ToStringGeneralTests.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000071 ${SELF_TEST_DIR}/ToStringPair.cpp
Phil Nashd5360e82017-01-12 11:54:53 +000072 ${SELF_TEST_DIR}/ToStringTuple.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000073 ${SELF_TEST_DIR}/ToStringVector.cpp
74 ${SELF_TEST_DIR}/ToStringWhich.cpp
Phil Nashd5360e82017-01-12 11:54:53 +000075 ${SELF_TEST_DIR}/TrickyTests.cpp
76 ${SELF_TEST_DIR}/VariadicMacrosTests.cpp
Phil Nash4e6938d2017-02-21 14:19:09 +000077 ${SELF_TEST_DIR}/MatchersTests.cpp
Phil Nash78e79942017-06-29 11:18:14 +010078 ${SELF_TEST_DIR}/String.tests.cpp
79 ${SELF_TEST_DIR}/StringBuilder.tests.cpp
80 ${SELF_TEST_DIR}/StringRef.tests.cpp
Phil Nash8abe17a2017-01-09 16:27:06 +000081 )
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +010082CheckFileList(TEST_SOURCES ${SELF_TEST_DIR})
Phil Nashd5360e82017-01-12 11:54:53 +000083
84# A set of impl files that just #include a single header
85# Please keep these ordered alphabetically
Martin Hořeňovskýfc321652017-07-06 22:28:42 +020086set(SURROGATE_SOURCES
Phil Nash30cebd62016-11-09 22:55:32 +000087 ${SELF_TEST_DIR}/SurrogateCpps/catch_console_colour.cpp
88 ${SELF_TEST_DIR}/SurrogateCpps/catch_debugger.cpp
89 ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_capture.cpp
90 ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_config.cpp
91 ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_exception.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000092 ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_registry_hub.cpp
93 ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_reporter.cpp
94 ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_runner.cpp
95 ${SELF_TEST_DIR}/SurrogateCpps/catch_interfaces_testcase.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000096 ${SELF_TEST_DIR}/SurrogateCpps/catch_option.cpp
Phil Nash30cebd62016-11-09 22:55:32 +000097 ${SELF_TEST_DIR}/SurrogateCpps/catch_stream.cpp
98 ${SELF_TEST_DIR}/SurrogateCpps/catch_streambuf.cpp
99 ${SELF_TEST_DIR}/SurrogateCpps/catch_test_spec.cpp
100 ${SELF_TEST_DIR}/SurrogateCpps/catch_xmlwriter.cpp
Phil Nash876af872017-01-23 15:18:23 +0000101 ${SELF_TEST_DIR}/SurrogateCpps/catch_test_case_tracker.cpp
Phil Nash30cebd62016-11-09 22:55:32 +0000102 )
Martin Hořeňovskýfc321652017-07-06 22:28:42 +0200103CheckFileList(SURROGATE_SOURCES ${SELF_TEST_DIR}/SurrogateCpps)
Kostace441a92013-08-05 12:40:33 +0200104
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100105
Phil Nashd5360e82017-01-12 11:54:53 +0000106# Please keep these ordered alphabetically
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100107set(TOP_LEVEL_HEADERS
Phil Nashe1fbbe12017-01-06 16:59:18 +0000108 ${HEADER_DIR}/catch.hpp
109 ${HEADER_DIR}/catch_session.hpp
110 ${HEADER_DIR}/catch_with_main.hpp
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100111 )
112CheckFileList(TOP_LEVEL_HEADERS ${HEADER_DIR})
Martin Hořeňovskýdab1d9d2017-01-25 23:02:25 +0100113
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100114# Please keep these ordered alphabetically
115set(EXTERNAL_HEADERS
Phil Nash1c223b62017-06-12 23:04:24 +0100116 ${HEADER_DIR}/external/clara.hpp
Phil Nashd5360e82017-01-12 11:54:53 +0000117 ${HEADER_DIR}/external/tbc_text_format.h
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100118 )
119CheckFileList(EXTERNAL_HEADERS ${HEADER_DIR}/external)
120
Martin Hořeňovskýdab1d9d2017-01-25 23:02:25 +0100121
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100122# Please keep these ordered alphabetically
123set(INTERNAL_HEADERS
Phil Nashe1fbbe12017-01-06 16:59:18 +0000124 ${HEADER_DIR}/internal/catch_approx.hpp
125 ${HEADER_DIR}/internal/catch_assertionresult.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000126 ${HEADER_DIR}/internal/catch_capture.hpp
127 ${HEADER_DIR}/internal/catch_clara.h
128 ${HEADER_DIR}/internal/catch_commandline.hpp
129 ${HEADER_DIR}/internal/catch_common.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000130 ${HEADER_DIR}/internal/catch_compiler_capabilities.h
131 ${HEADER_DIR}/internal/catch_config.hpp
132 ${HEADER_DIR}/internal/catch_console_colour.hpp
Phil Nashe1fbbe12017-01-06 16:59:18 +0000133 ${HEADER_DIR}/internal/catch_context.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000134 ${HEADER_DIR}/internal/catch_debugger.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000135 ${HEADER_DIR}/internal/catch_default_main.hpp
Martin Hořeňovskýfc321652017-07-06 22:28:42 +0200136 ${HEADER_DIR}/internal/catch_errno_guard.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000137 ${HEADER_DIR}/internal/catch_evaluate.hpp
138 ${HEADER_DIR}/internal/catch_exception_translator_registry.hpp
139 ${HEADER_DIR}/internal/catch_expression_lhs.hpp
Martin Hořeňovskýfc321652017-07-06 22:28:42 +0200140 ${HEADER_DIR}/internal/catch_fatal_condition.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000141 ${HEADER_DIR}/internal/catch_impl.hpp
142 ${HEADER_DIR}/internal/catch_interfaces_capture.h
143 ${HEADER_DIR}/internal/catch_interfaces_config.h
144 ${HEADER_DIR}/internal/catch_interfaces_exception.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000145 ${HEADER_DIR}/internal/catch_interfaces_registry_hub.h
146 ${HEADER_DIR}/internal/catch_interfaces_reporter.h
147 ${HEADER_DIR}/internal/catch_interfaces_runner.h
148 ${HEADER_DIR}/internal/catch_interfaces_tag_alias_registry.h
149 ${HEADER_DIR}/internal/catch_interfaces_testcase.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000150 ${HEADER_DIR}/internal/catch_list.hpp
151 ${HEADER_DIR}/internal/catch_matchers.hpp
Phil Nash14001272017-02-08 15:14:51 +0000152 ${HEADER_DIR}/internal/catch_matchers_string.h
Phil Nash10dfca32017-02-21 16:05:04 +0000153 ${HEADER_DIR}/internal/catch_matchers_vector.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000154 ${HEADER_DIR}/internal/catch_message.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000155 ${HEADER_DIR}/internal/catch_notimplemented_exception.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000156 ${HEADER_DIR}/internal/catch_objc.hpp
157 ${HEADER_DIR}/internal/catch_objc_arc.hpp
158 ${HEADER_DIR}/internal/catch_option.hpp
159 ${HEADER_DIR}/internal/catch_platform.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000160 ${HEADER_DIR}/internal/catch_reenable_warnings.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000161 ${HEADER_DIR}/internal/catch_reporter_registrars.hpp
162 ${HEADER_DIR}/internal/catch_reporter_registry.hpp
163 ${HEADER_DIR}/internal/catch_result_builder.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000164 ${HEADER_DIR}/internal/catch_result_type.h
165 ${HEADER_DIR}/internal/catch_run_context.hpp
166 ${HEADER_DIR}/internal/catch_section.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000167 ${HEADER_DIR}/internal/catch_section_info.h
Martin Hořeňovskýda0edcb2017-06-04 21:39:27 +0200168 ${HEADER_DIR}/internal/catch_startup_exception_registry.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000169 ${HEADER_DIR}/internal/catch_stream.h
170 ${HEADER_DIR}/internal/catch_stream.hpp
171 ${HEADER_DIR}/internal/catch_streambuf.h
Phil Nash78e79942017-06-29 11:18:14 +0100172 ${HEADER_DIR}/internal/catch_string.h
Phil Nash78e79942017-06-29 11:18:14 +0100173 ${HEADER_DIR}/internal/catch_stringbuilder.h
Phil Nash78e79942017-06-29 11:18:14 +0100174 ${HEADER_DIR}/internal/catch_stringdata.h
Phil Nash78e79942017-06-29 11:18:14 +0100175 ${HEADER_DIR}/internal/catch_stringref.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000176 ${HEADER_DIR}/internal/catch_suppress_warnings.h
177 ${HEADER_DIR}/internal/catch_tag_alias.h
178 ${HEADER_DIR}/internal/catch_tag_alias_registry.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000179 ${HEADER_DIR}/internal/catch_test_case_info.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000180 ${HEADER_DIR}/internal/catch_test_case_registry_impl.hpp
181 ${HEADER_DIR}/internal/catch_test_case_tracker.hpp
182 ${HEADER_DIR}/internal/catch_test_registry.hpp
183 ${HEADER_DIR}/internal/catch_test_spec.hpp
184 ${HEADER_DIR}/internal/catch_test_spec_parser.hpp
185 ${HEADER_DIR}/internal/catch_text.h
186 ${HEADER_DIR}/internal/catch_timer.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000187 ${HEADER_DIR}/internal/catch_tostring.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000188 ${HEADER_DIR}/internal/catch_totals.hpp
189 ${HEADER_DIR}/internal/catch_version.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000190 ${HEADER_DIR}/internal/catch_wildcard_pattern.hpp
Martin Hořeňovský531d2672017-01-16 19:56:57 +0100191 ${HEADER_DIR}/internal/catch_windows_h_proxy.h
Phil Nashe1fbbe12017-01-06 16:59:18 +0000192 ${HEADER_DIR}/internal/catch_xmlwriter.hpp
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100193 )
Martin Hořeňovskýfc321652017-07-06 22:28:42 +0200194set(IMPL_SOURCES
195 ${HEADER_DIR}/internal/catch_assertionresult.cpp
196 ${HEADER_DIR}/internal/catch_common.cpp
197 ${HEADER_DIR}/internal/catch_console_colour.cpp
198 ${HEADER_DIR}/internal/catch_context.cpp
199 ${HEADER_DIR}/internal/catch_debugger.cpp
200 ${HEADER_DIR}/internal/catch_errno_guard.cpp
201 ${HEADER_DIR}/internal/catch_fatal_condition.cpp
202 ${HEADER_DIR}/internal/catch_matchers_string.cpp
203 ${HEADER_DIR}/internal/catch_message.cpp
204 ${HEADER_DIR}/internal/catch_notimplemented_exception.cpp
205 ${HEADER_DIR}/internal/catch_registry_hub.cpp
206 ${HEADER_DIR}/internal/catch_result_builder.cpp
207 ${HEADER_DIR}/internal/catch_section.cpp
208 ${HEADER_DIR}/internal/catch_section_info.cpp
209 ${HEADER_DIR}/internal/catch_startup_exception_registry.cpp
210 ${HEADER_DIR}/internal/catch_string.cpp
211 ${HEADER_DIR}/internal/catch_stringbuilder.cpp
212 ${HEADER_DIR}/internal/catch_stringdata.cpp
213 ${HEADER_DIR}/internal/catch_stringref.cpp
214 ${HEADER_DIR}/internal/catch_tag_alias_registry.cpp
215 ${HEADER_DIR}/internal/catch_test_case_info.cpp
216 ${HEADER_DIR}/internal/catch_timer.cpp
217 ${HEADER_DIR}/internal/catch_tostring.cpp
218 ${HEADER_DIR}/internal/catch_version.cpp
219 )
220set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS})
221CheckFileList(INTERNAL_FILES ${HEADER_DIR}/internal)
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100222
223# Please keep these ordered alphabetically
224set(REPORTER_HEADERS
Justin Wilsonb753f052017-02-22 04:17:25 -0600225 ${HEADER_DIR}/reporters/catch_reporter_automake.hpp
Phil Nashe1fbbe12017-01-06 16:59:18 +0000226 ${HEADER_DIR}/reporters/catch_reporter_bases.hpp
227 ${HEADER_DIR}/reporters/catch_reporter_compact.hpp
228 ${HEADER_DIR}/reporters/catch_reporter_console.hpp
229 ${HEADER_DIR}/reporters/catch_reporter_junit.hpp
230 ${HEADER_DIR}/reporters/catch_reporter_multi.hpp
Martin Hořeňovskýb0260c62017-02-22 13:28:13 +0100231 ${HEADER_DIR}/reporters/catch_reporter_tap.hpp
Phil Nashe1fbbe12017-01-06 16:59:18 +0000232 ${HEADER_DIR}/reporters/catch_reporter_teamcity.hpp
233 ${HEADER_DIR}/reporters/catch_reporter_xml.hpp
234 )
Martin Hořeňovskýe6ef60a2017-01-15 22:07:36 +0100235CheckFileList(REPORTER_HEADERS ${HEADER_DIR}/reporters)
236
237# Specify the headers, too, so CLion recognises them as project files
238set(HEADERS
239 ${TOP_LEVEL_HEADERS}
240 ${EXTERNAL_HEADERS}
241 ${INTERNAL_HEADERS}
242 ${REPORTER_HEADERS}
243 )
244
Phil Nashe1fbbe12017-01-06 16:59:18 +0000245
Martin Hořeňovský3b7511e2017-01-14 21:55:37 +0100246set(BENCH_SOURCES
247 ${BENCHMARK_DIR}/BenchMain.cpp
248 ${BENCHMARK_DIR}/StringificationBench.cpp
249 )
Martin Hořeňovskýdab1d9d2017-01-25 23:02:25 +0100250CheckFileList(BENCH_SOURCES ${BENCHMARK_DIR})
251
Phil Nashd5360e82017-01-12 11:54:53 +0000252# Provide some groupings for IDEs
Phil Nash8abe17a2017-01-09 16:27:06 +0000253SOURCE_GROUP("Tests" FILES ${TEST_SOURCES})
Martin Hořeňovskýfc321652017-07-06 22:28:42 +0200254SOURCE_GROUP("Surrogates" FILES ${SURROGATE_SOURCES})
Martin Hořeňovský3b7511e2017-01-14 21:55:37 +0100255SOURCE_GROUP("Benchmarks" FILES ${BENCH_SOURCES})
Phil Nash8abe17a2017-01-09 16:27:06 +0000256
Kostace441a92013-08-05 12:40:33 +0200257# configure the executable
Phil Nashe1fbbe12017-01-06 16:59:18 +0000258include_directories(${HEADER_DIR})
Kostace441a92013-08-05 12:40:33 +0200259
Phil Nash78e79942017-06-29 11:18:14 +0100260add_definitions( -DCATCH_CONFIG_FULL_PROJECT )
261
Martin Hořeňovský9ceae8f2017-04-28 20:27:10 +0200262# Projects consuming Catch via ExternalProject_Add might want to use install step
263# without building all of our selftests.
264if (NOT NO_SELFTEST)
Martin Hořeňovskýfc321652017-07-06 22:28:42 +0200265 add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${SURROGATE_SOURCES} ${HEADERS})
266 add_executable(Benchmark ${BENCH_SOURCES} ${IMPL_SOURCES} ${HEADERS})
Martin Hořeňovský9ceae8f2017-04-28 20:27:10 +0200267
268 # Add desired warnings
269 if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
270 target_compile_options( SelfTest PRIVATE -Wall -Wextra )
271 target_compile_options( Benchmark PRIVATE -Wall -Wextra )
272 endif()
273 if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
274 target_compile_options( SelfTest PRIVATE /W4 /w44265 /WX )
275 target_compile_options( Benchmark PRIVATE /W4 )
276 endif()
Martin Hořeňovský7ae96c72017-01-31 17:37:27 +0100277
278
Martin Hořeňovský9ceae8f2017-04-28 20:27:10 +0200279 # configure unit tests via CTest
280 enable_testing()
281 add_test(NAME RunTests COMMAND SelfTest)
Fraser Hutchison69a3f162013-10-24 02:57:46 +0100282
Martin Hořeňovský9ceae8f2017-04-28 20:27:10 +0200283 add_test(NAME ListTests COMMAND SelfTest --list-tests)
284 set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
Fraser Hutchison69a3f162013-10-24 02:57:46 +0100285
Martin Hořeňovský9ceae8f2017-04-28 20:27:10 +0200286 add_test(NAME ListTags COMMAND SelfTest --list-tags)
287 set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")
288
289endif() # !NO_SELFTEST
290
Saad K7dd4f292017-01-31 14:22:45 -0500291
Rian Quinn79ce6932017-03-22 14:19:51 -0600292install(DIRECTORY "single_include/" DESTINATION "include/catch")