@@ -38,6 +38,7 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
38
38
[OUTPUT_PREFIX prefix]
39
39
[OUTPUT_SUFFIX suffix]
40
40
[DISCOVERY_MODE <POST_BUILD|PRE_TEST>]
41
+ [SKIP_IS_FAILURE]
41
42
)
42
43
43
44
``catch_discover_tests`` sets up a post-build command on the test executable
@@ -131,7 +132,7 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
131
132
of test cases from the test executable and when the tests are executed themselves.
132
133
This requires cmake/ctest >= 3.22.
133
134
134
- `DISCOVERY_MODE mode``
135
+ `` DISCOVERY_MODE mode``
135
136
Provides control over when ``catch_discover_tests`` performs test discovery.
136
137
By default, ``POST_BUILD`` sets up a post-build command to perform test discovery
137
138
at build time. In certain scenarios, like cross-compiling, this ``POST_BUILD``
@@ -143,6 +144,9 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
143
144
``CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE`` variable if it is not passed when
144
145
calling ``catch_discover_tests``. This provides a mechanism for globally selecting
145
146
a preferred test discovery behavior without having to modify each call site.
147
+
148
+ ``SKIP_IS_FAILURE``
149
+ Disables skipped test detection.
146
150
147
151
#]=======================================================================]
148
152
@@ -151,7 +155,7 @@ function(catch_discover_tests TARGET)
151
155
152
156
cmake_parse_arguments (
153
157
""
154
- ""
158
+ "SKIP_IS_FAILURE "
155
159
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX;DISCOVERY_MODE"
156
160
"TEST_SPEC;EXTRA_ARGS;PROPERTIES;DL_PATHS;DL_FRAMEWORK_PATHS"
157
161
${ARGN}
@@ -192,6 +196,9 @@ function(catch_discover_tests TARGET)
192
196
TARGET ${TARGET}
193
197
PROPERTY CROSSCOMPILING_EMULATOR
194
198
)
199
+ if (NOT _SKIP_IS_FAILURE)
200
+ set (_PROPERTIES ${_PROPERTIES} SKIP_RETURN_CODE 4)
201
+ endif ()
195
202
196
203
if (_DISCOVERY_MODE STREQUAL "POST_BUILD" )
197
204
add_custom_command (
0 commit comments