From 9aab95866720281036d25e7e1c3dd0b0d7cad30b Mon Sep 17 00:00:00 2001 From: Clare Macrae Date: Sun, 21 Jul 2019 20:53:59 +0100 Subject: [PATCH] Add section headers, so I can later say when features were introduced --- 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 @@ # 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.