Commit Graph

27 Commits

Author SHA1 Message Date
Blake-Madden 4ab0af8baf
Fix minor typos in documentation (#2769)
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2023-12-10 22:01:13 +01:00
Gerald Senarclens de Grancy 2c68a0d05f lifted suggested version
Did this, because with 3.0.1, the files
- catch_xmlwriter.cpp
- catch_string_manip.hpp
- catch_test_case_info.hpp

were missing

This led to some obvious and some obscure compile errors when compiling
with g++ 13.2.0 (std c++17 or c++20)
One of these errors being "Elaborated-type-specifier for a scoped enum
must not use the ‘class’ keyword"

Since this is a rather bad experience and debugging it is
time-consuming, I suggest to simply boost the recommended version in the
snippet which is likely copied by new Catch2 users
2023-11-14 17:10:31 +01:00
Holger Kaelberer aad926baf8 Catch.cmake: Add new DISCOVERY_MODE option to catch_discover_tests
Introducing a new DISCOVERY_MODE mode option, which provides greater
control over when catch_discover_tests perforsm test discovery.

It has two supported modes:
* POST_BUILD: The default behavior, which adds a POST_BUILD command
  to perform test discovery after the test has been built as was
  always done so far.

* PRE_TEST: New mode, which delays test discovery until test execution.
  The generated include file generates the appropriate CTest files at
  runtime and regenerates the CTest files when the executable is
  updated.
  This mode can be used in build-environments that don't allow for
  executing the linked binaries at build-time (like in a
  cross-compilation environment).

DISCOVERY_MODE can be controlled in two ways:
1. Setting the DISCOVERY_MODE when calling catch_discover_tests.

2. Setting the global CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE prior
   to calling gtest_discover_tests.

Closes #2493
2023-04-19 23:51:42 +02:00
Kamil Kisiel 4ff9be3bc5
cmake-integration.md: Use "tests" as test target name in all examples. 2023-02-10 11:09:26 -08:00
tocic dea1a6abd9
Fix typos in docs (#2514) 2022-09-09 16:00:39 +02:00
Martin Hořeňovský 97c48e0c34
v3.1.0 2022-07-17 20:18:44 +02:00
Martin Hořeňovský 34d9724058
Add experimental CMake script for sharding tests in binaries 2022-06-24 14:12:55 +02:00
Martin Hořeňovský 8c952bd076
Point to 3.0.1 in FetchContent example
Closes #2326
Closes #2438
2022-05-31 11:49:24 +02:00
Martin Hořeňovský 3a18a688a0
Mention CMake's integration with CATCH_CONFIG options 2022-05-21 13:04:09 +02:00
Martin Hořeňovský 39d3de17f3
Fix mentions of CATCH_INSTALL_HELPERS
Fixes #2347
2022-01-06 23:37:44 +01:00
Martin Hořeňovský 1554251f97
Fix typo in docs/cmake-integration.md 2021-08-11 22:57:36 +02:00
Kin Numaru 74db06199b
Rename contrib/ to extras/ in the docs
The directory has been renamed in 918aa32 but the doc was not updated
yet.
2021-08-10 10:41:16 +02:00
Martin Hořeňovský 1e0dc61d16
Update CMake integration documentation 2021-07-31 21:46:11 +02:00
Vishesh Yadav 6f21a3609c 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
2021-06-30 00:12:36 +02:00
Martin Hořeňovský 342dd3445c
Pick documentation changes for 2.13.4 2021-05-09 18:05:31 +02:00
Reinhold Gschweicher 48f220b68a
Add deprecation warning in ParseAndCatchTests
Parsing C++ with regex in CMake is error prone and regularly leads to silently
dropped (not run) test cases.

Going forward the function `catch_discover_tests` from `contrib/CMake.cmake`
should be used.

For more information see https://github.com/catchorg/Catch2/issues/2092#issuecomment-747342765
2021-05-09 18:05:25 +02:00
Florian Berchtold 045feff834
Update cmake-integration.md (#2115)
* Update cmake-integration.md

CMake related, mainly more modern and provide an executable to be correct

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2020-12-28 13:41:55 +01:00
Emil Jarosz b9fe8a208f
Update cmake-integration.md
The "contrib" folder was renamed to "extras", but the name wasn't updated in the documentation.
2020-11-30 13:10:26 +00:00
Martin Stump c522e88afa
Add REPORTER and OUTPUT_* args 2020-10-08 11:35:42 +02:00
Florian Berchtold b1df96e7e4
Docu/Show how to use CMake FetchContent (#2028) 2020-10-08 11:35:18 +02:00
Phoebe 46cc551b7a
Add vcpkg installation instructions (#1898)
* Add vcpkg installation instructions

* Add index
2020-05-01 09:31:41 +02:00
Martin Hořeňovský ddd0e7218d
Remove the !hide special tag 2020-01-28 20:48:32 +01:00
Robin Lindén 7be35af167
Use correct filename in CMake integration docs 2019-04-07 15:41:34 +02:00
Stephane Del Pino 544c7d7cbf Add the optional variable OptionalCatchTestLauncher
This variable is set to allow the use of the nice ParseAndAddCatchTests script
in the case where a launcher is needed to execute  the script.

This is introduced to allow to launch unit tests using mpi. In this case one can
write for instance
  set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC})
before calling the ParseAndAddCatchTests function.
2018-10-25 15:51:15 +02:00
Martin Hořeňovský 9e6d7bbf00 Add documentation for installing Catch from the repository
This might prove helpful when the package managers either doesn't
have Catch at all, or provides it in obsolete version (Ubuntu 16.04,
I am looking at you).

Closes #1383
2018-09-21 20:48:18 +02:00
Martin Hořeňovský 797d3b04df Reinstate CATCH_BUILD_TESTING CMake option 2018-07-22 18:01:42 +02:00
Martin Hořeňovský bf221583b1 Update CMake and build documentation 2018-06-24 12:32:22 +02:00