mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-24 22:36:10 +01:00
f7cd0ba051
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>
2.7 KiB
2.7 KiB
List of examples
Already available
- Test Case: Single-file
- Test Case: Multiple-file 1, 2
- Assertion: REQUIRE, CHECK
- Fixture: Sections
- Fixture: Class-based fixtures
- Fixture: Persistent fixtures
- BDD: SCENARIO, GIVEN, WHEN, THEN
- Listener: Listeners
- Configuration: Provide your own output streams
- Generators: Create your own generator
- Generators: Use map to convert types in GENERATE expression
- Generators: Run test with a table of input values
- Generators: Use variables in generator expressions
- Generators: Use custom variable capture in generator expressions
Planned
- Assertion: REQUIRE_THAT and Matchers
- Assertion: REQUIRE_NO_THROW
- Assertion: REQUIRE_THROWS
- Assertion: REQUIRE_THROWS_AS
- Assertion: REQUIRE_THROWS_WITH
- Assertion: REQUIRE_THROWS_MATCHES
- Floating point: Approx - Comparisons
- Logging: CAPTURE - Capture expression
- Logging: INFO - Provide information with failure
- Logging: WARN - Issue warning
- Logging: FAIL, FAIL_CHECK - Issue message and force failure/continue
- Logging: SUCCEED - Issue message and continue
- Report: User-defined type
- Report: User-defined reporter
- Report: Automake reporter
- Report: TAP reporter
- Report: Multiple reporter
- Configuration: Provide your own main()
- Configuration: Compile-time configuration
- Configuration: Run-time configuration