Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Update CMake doc for automatic test registration

`FetchContent` doesn't include `contrib` directory as part of `CMAKE_MODULE_PATH`. This results into `include(Catch)` to fail. This patch just updates the documentation describing how to do include the path, so the new users don't have to figure this out themselves.

Source: https://github.com/catchorg/Catch2/issues/2103#issuecomment-730626324
Commit
6f21a3609cea360846a0ca93be55877cca14c86d
Author
Vishesh Yadav ·
Committer
Martin Hořeňovský
Parents
bf61a418cbc4

Files · Download .tar.gz

Changes

 docs/cmake-integration.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/docs/cmake-integration.md b/docs/cmake-integration.md
index 4faa9bda..0414f44c 100644
--- a/docs/cmake-integration.md
+++ b/docs/cmake-integration.md
@@ -88,6 +88,18 @@ include(Catch)
 catch_discover_tests(foo)
 ```
 
+When using `FetchContent`, `include(Catch)` will fail unless 
+`CMAKE_MODULE_PATH` is explicitly updated to include the contrib
+directory.
+
+```cmake
+# ... FetchContent ...
+#
+list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/contrib)
+include(CTest)
+include(Catch)
+catch_discover_tests()
+```
 
 #### Customization
 `catch_discover_tests` can be given several extra argumets: