Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2024-09-16 22:18:49 +0200
committerMartin Hořeňovský2024-09-17 09:35:43 +0200
commit79f2d66ea3f018c00ed78b1ed89806e6f86b1ef0 (patch)
tree0f68297c232dbfe018090e4674efe5f260ec4434
parente200443b84acbfbfab849a032300e6544d3ee9aa (diff)
downloadcatch3-79f2d66ea3f018c00ed78b1ed89806e6f86b1ef0.tar.gz
Use SKIP_RETURN_CODE test property in catch_discover_tests
I also added `SKIP_IS_FAILURE` option to the `catch_discover_tests` function, to allow users to get back the old behaviour. Closes #2873
-rw-r--r--extras/Catch.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/extras/Catch.cmake b/extras/Catch.cmake
index e080665b..c1712885 100644
--- a/extras/Catch.cmake
+++ b/extras/Catch.cmake
@@ -38,6 +38,7 @@ same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
[OUTPUT_PREFIX prefix]
[OUTPUT_SUFFIX suffix]
[DISCOVERY_MODE <POST_BUILD|PRE_TEST>]
+ [SKIP_IS_FAILURE]
)
``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``.
of test cases from the test executable and when the tests are executed themselves.
This requires cmake/ctest >= 3.22.
- `DISCOVERY_MODE mode``
+ ``DISCOVERY_MODE mode``
Provides control over when ``catch_discover_tests`` performs test discovery.
By default, ``POST_BUILD`` sets up a post-build command to perform test discovery
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``.
``CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE`` variable if it is not passed when
calling ``catch_discover_tests``. This provides a mechanism for globally selecting
a preferred test discovery behavior without having to modify each call site.
+
+ ``SKIP_IS_FAILURE``
+ Disables skipped test detection.
#]=======================================================================]
@@ -151,7 +155,7 @@ function(catch_discover_tests TARGET)
cmake_parse_arguments(
""
- ""
+ "SKIP_IS_FAILURE"
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;REPORTER;OUTPUT_DIR;OUTPUT_PREFIX;OUTPUT_SUFFIX;DISCOVERY_MODE"
"TEST_SPEC;EXTRA_ARGS;PROPERTIES;DL_PATHS;DL_FRAMEWORK_PATHS"
${ARGN}
@@ -192,6 +196,9 @@ function(catch_discover_tests TARGET)
TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR
)
+ if (NOT _SKIP_IS_FAILURE)
+ set(_PROPERTIES ${_PROPERTIES} SKIP_RETURN_CODE 4)
+ endif()
if(_DISCOVERY_MODE STREQUAL "POST_BUILD")
add_custom_command(