ParseAndAddCatchTests

Define function ParseAndAddCatchTests() to parse a C++ source file for Catch2 tests and register them with add_test().

Note

This file differs from ParseAndAddCatchTests.cmake as bundled with Catch2 principally through the addition of options TargetsVar and ExtraLabels.

ParseAndAddCatchTests

Parse a C++ source file for Catch2 tests and register them with add_test().

ParseAndAddCatchTests(<TestTarget> [<options>])

Options

TargetsVar <var>

Defined targets will be returned in <var>.

ExtraLabels <label> ...

Add CMake test labels <label> ... to each defined test.

Details

Deprecated since version 3.23.00: Instead, use:

include(Catch)
catch_discover_tests(<TestTarget>)

See also

Catch.cmake as bundled with Catch2.