catch2/examples
Keith Stockdale f7cd0ba051
TEST_CASE_PERSISTENT_FIXTURE: A new fixture macro for allowing persistent fixtures throughout a TEST_CASE (#2885)
This PR introduces a new `TEST_CASE` macro called `TEST_CASE_PERSISTENT_FIXTURE`. `TEST_CASE_PERSISTENT_FIXTURE` offers the same functionality as `TEST_CASE_METHOD` except for one difference. The object on which the test method is invoked is only created once for all invocations of the test case. The object is created just after the `testCaseStarting` event is broadcast and the object is destroyed just before the `testCaseEnding` event is broadcast.

The main motivation for this new functionality is to allow `TEST_CASE`s to do expensive setup and teardown once per `TEST_CASE`, without having to resort to abusing event listeners or static function variables with manual initialization.


Implements #1602

---------

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
2024-08-05 17:01:41 +02:00
..
010-TestCase.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
020-TestCase-1.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
020-TestCase-2.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
030-Asn-Require-Check.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
100-Fix-Section.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
110-Fix-ClassFixture.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
111-Fix-PersistentFixture.cpp TEST_CASE_PERSISTENT_FIXTURE: A new fixture macro for allowing persistent fixtures throughout a TEST_CASE (#2885) 2024-08-05 17:01:41 +02:00
120-Bdd-ScenarioGivenWhenThen.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
210-Evt-EventListeners.cpp Fix various useful clang-tidy warnings 2024-03-01 21:24:45 +01:00
231-Cfg-OutputStreams.cpp Fix various useful clang-tidy warnings 2024-03-01 21:24:45 +01:00
232-Cfg-CustomMain.cpp Fix various useful clang-tidy warnings 2024-03-01 21:24:45 +01:00
300-Gen-OwnGenerator.cpp Fix various useful clang-tidy warnings 2024-03-01 21:24:45 +01:00
301-Gen-MapTypeConversion.cpp Fix various useful clang-tidy warnings 2024-03-01 21:24:45 +01:00
302-Gen-Table.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
310-Gen-VariablesInGenerators.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
311-Gen-CustomCapture.cpp Add nice license headers to files in examples/ and fuzzing/ 2023-08-24 16:34:31 +02:00
CMakeLists.txt TEST_CASE_PERSISTENT_FIXTURE: A new fixture macro for allowing persistent fixtures throughout a TEST_CASE (#2885) 2024-08-05 17:01:41 +02:00