Progmasoft Git

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

tests for TEMPLATE_LIST_TEST_CASE

Commit
dbc1295354ee1f07fff39946dc963c71bc5436a7
Author
Jozef Grajciar ·
Committer
Martin Hořeňovský
Parents
f2cfc2b852e6

Files · Download .tar.gz

Changes

 projects/SelfTest/UsageTests/Class.tests.cpp | 6 ++++++
 projects/SelfTest/UsageTests/Misc.tests.cpp  | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/projects/SelfTest/UsageTests/Class.tests.cpp b/projects/SelfTest/UsageTests/Class.tests.cpp
index 815bb4fd..f658fc19 100644
--- a/projects/SelfTest/UsageTests/Class.tests.cpp
+++ b/projects/SelfTest/UsageTests/Class.tests.cpp
@@ -98,6 +98,12 @@ TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(Template_Fixture_2, "A TEMPLATE_PRODUCT_TE
     REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() >= 2);
 }
 
+using MyTypes = std::tuple<int, char, double>;
+TEMPLATE_LIST_TEST_CASE_METHOD(Template_Fixture, "Template test case method with test types specified inside std::tuple", "[class][template][list]", MyTypes)
+{
+    REQUIRE( Template_Fixture<TestType>::m_a == 1 );
+}
+
 // We should be able to write our tests within a different namespace
 namespace Inner
 {
diff --git a/projects/SelfTest/UsageTests/Misc.tests.cpp b/projects/SelfTest/UsageTests/Misc.tests.cpp
index 9a87169b..763c6194 100644
--- a/projects/SelfTest/UsageTests/Misc.tests.cpp
+++ b/projects/SelfTest/UsageTests/Misc.tests.cpp
@@ -365,6 +365,12 @@ TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product
     REQUIRE(std::tuple_size<TestType>::value >= 1);
 }
 
+using MyTypes = std::tuple<int, char, float>;
+TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes)
+{
+    REQUIRE(sizeof(TestType) > 0);
+}
+
 // https://github.com/philsquared/Catch/issues/166
 TEST_CASE("A couple of nested sections followed by a failure", "[failing][.]") {
     SECTION("Outer")