mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 10:42:25 +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> |
||
---|---|---|
.. | ||
assertions.md | ||
benchmarks.md | ||
ci-and-misc.md | ||
cmake-integration.md | ||
command-line.md | ||
commercial-users.md | ||
comparing-floating-point-numbers.md | ||
configuration.md | ||
contributing.md | ||
deprecations.md | ||
event-listeners.md | ||
faq.md | ||
generators.md | ||
limitations.md | ||
list-of-examples.md | ||
logging.md | ||
matchers.md | ||
migrate-v2-to-v3.md | ||
opensource-users.md | ||
other-macros.md | ||
own-main.md | ||
Readme.md | ||
release-notes.md | ||
release-process.md | ||
reporter-events.md | ||
reporters.md | ||
skipping-passing-failing.md | ||
test-cases-and-sections.md | ||
test-fixtures.md | ||
tostring.md | ||
tutorial.md | ||
usage-tips.md | ||
why-catch.md |
Reference
To get the most out of Catch2, start with the tutorial. Once you're up and running consider the following reference material.
Writing tests:
- Assertion macros
- Matchers (asserting complex properties)
- Comparing floating point numbers
- Logging macros
- Test cases and sections
- Test fixtures
- Explicitly skipping, passing, and failing tests at runtime
- Reporters (output customization)
- Event Listeners
- Data Generators (value parameterized tests)
- Other macros
- Micro benchmarking
Fine tuning:
Running:
Odds and ends:
- Frequently Asked Questions (FAQ)
- Best practices and other tips
- CMake integration
- Tooling integration (CI, test runners, other)
- Known limitations
Other: