mirror of
https://github.com/catchorg/Catch2.git
synced 2025-07-30 02:37:37 +02:00
Support adding test tags as CTest labels in catch_discover_tests
We also bump the minimum CMake version to 3.20 as per #2943
This commit is contained in:
@ -81,12 +81,11 @@ to your CMake module path.
|
||||
|
||||
`Catch.cmake` provides function `catch_discover_tests` to get tests from
|
||||
a target. This function works by running the resulting executable with
|
||||
`--list-test-names-only` flag, and then parsing the output to find all
|
||||
existing tests.
|
||||
`--list-test` flag, and then parsing the output to find all existing tests.
|
||||
|
||||
#### Usage
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(baz LANGUAGES CXX VERSION 0.0.1)
|
||||
|
||||
@ -128,6 +127,8 @@ catch_discover_tests(target
|
||||
[OUTPUT_PREFIX prefix]
|
||||
[OUTPUT_SUFFIX suffix]
|
||||
[DISCOVERY_MODE <POST_BUILD|PRE_TEST>]
|
||||
[SKIP_IS_FAILURE]
|
||||
[ADD_TAGS_AS_LABELS]
|
||||
)
|
||||
```
|
||||
|
||||
@ -211,6 +212,15 @@ execution (useful e.g. in cross-compilation environments).
|
||||
calling ``catch_discover_tests``. This provides a mechanism for globally
|
||||
selecting a preferred test discovery behavior.
|
||||
|
||||
* `SKIP_IS_FAILURE`
|
||||
|
||||
Skipped tests will be marked as failed instead.
|
||||
|
||||
* `ADD_TAGS_AS_LABELS`
|
||||
|
||||
Add the tags from tests as labels to CTest.
|
||||
|
||||
|
||||
### `ParseAndAddCatchTests.cmake`
|
||||
|
||||
⚠ This script is [deprecated](https://github.com/catchorg/Catch2/pull/2120)
|
||||
@ -229,7 +239,7 @@ parsed are *silently ignored*.
|
||||
#### Usage
|
||||
|
||||
```cmake
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(baz LANGUAGES CXX VERSION 0.0.1)
|
||||
|
||||
|
Reference in New Issue
Block a user