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
Add section headers, so I can later say when features were introduced
- Commit
9aab95866720281036d25e7e1c3dd0b0d7cad30b- Author
- Clare Macrae ·
- Committer
- Martin Hořeňovský
- Parents
8cd58f75ec78
Changes
docs/test-fixtures.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/test-fixtures.md b/docs/test-fixtures.md index baed1676..a3fdb9ff 100644 --- a/docs/test-fixtures.md +++ b/docs/test-fixtures.md @@ -1,6 +1,8 @@ <a id="top"></a> # Test fixtures +## Defining test fixtures + Although Catch allows you to group tests together as sections within a test case, it can still be convenient, sometimes, to group them using a more traditional test fixture. Catch fully supports this too. You define the test fixture as a simple structure: ```c++ @@ -84,6 +86,7 @@ _While there is an upper limit on the number of types you can specify in single `TEMPLATE_TEST_CASE_METHOD` or `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, the limit is very high and should not be encountered in practice._ +## Signature-based parametrised test fixtures Catch2 also provides `TEMPLATE_TEST_CASE_METHOD_SIG` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG` to support fixtures using non-type template parameters. These test cases work similar to `TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, @@ -118,6 +121,8 @@ TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(Template_Fixture_2, "A TEMPLATE_PRODUCT_TE } ``` +## Template fixtures with types specified in template type lists + Catch2 also provides `TEMPLATE_LIST_TEST_CASE_METHOD` to support template fixtures with types specified in template type lists like `std::tuple`, `boost::mpl::list` or `boost::mp11::mp_list`. This test case works the same as `TEMPLATE_TEST_CASE_METHOD`, only difference is the source of types. This allows you to reuse the template type list in multiple test cases.