Catch
Last updated
Was this helpful?
Last updated
Was this helpful?
Catch and (C++11 only version) are powerful, idomatic testing solutions similar in philosophy to PyTest for Python. To use Catch in a CMake project, there are several options.
If you simply drop in the single include release of Catch into your project, this is what you would need to add Catch:
Then, you would link to Catch2::Catch. This would have been okay as an INTERFACE target since you won't be exporting your tests.
If you add the library using ExternalProject, FetchContent, or git submodules, you can also add_subdirectory
Catch (CMake 3.1+).
Catch also provides two CMake modules that you can use to register the individual tests with CMake.