forked from catchorg/Catch2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trivial tests for most test macros
For every macro only a single parameter set is used. This needs to test all parameter combinations that are allowed for catchorg#2092.
- Loading branch information
1 parent
fac517d
commit c36f951
Showing
2 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
projects/SelfTest/UsageTests/CMakeCTestRegistration.tests.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#include "catch.hpp" | ||
|
||
#include <tuple> | ||
|
||
namespace { namespace CMakeCTestRegistrationTests { | ||
|
||
static void testFunction(){} | ||
|
||
struct FakeFixture | ||
{ | ||
void fakeTest(){} | ||
}; | ||
template<typename...> struct TemplateFixture{}; | ||
template<int> struct FixtureWithValue{}; | ||
|
||
template<typename> struct TemplateStruct{}; | ||
template<int> struct CompileTimeValue{}; | ||
|
||
using SimpleTestTypes = std::tuple<int>; | ||
|
||
|
||
SCENARIO("scenario", "[cmake_integration]"){} | ||
|
||
SCENARIO_METHOD(FakeFixture, "scenario_method", "[cmake_integration]"){} | ||
|
||
TEMPLATE_TEST_CASE("template_test_case", "[cmake_integration]", int){} | ||
|
||
TEMPLATE_TEST_CASE_SIG("template_test_case_sig", "[cmake_integration]", ((int V), V), 42){} | ||
|
||
TEMPLATE_TEST_CASE_METHOD(TemplateFixture, "template_test_case_method", "[cmake_integration]", int){} | ||
|
||
TEMPLATE_TEST_CASE_METHOD_SIG(FixtureWithValue, | ||
"template_test_case_method_sig", | ||
"[cmake_integration]", | ||
((int V), V), 42) | ||
{} | ||
|
||
TEMPLATE_LIST_TEST_CASE("template_list_test_case", "[cmake_integration]", SimpleTestTypes){} | ||
|
||
TEMPLATE_LIST_TEST_CASE_METHOD(TemplateFixture, | ||
"template_list_test_case_method", "[cmake_integration]", | ||
SimpleTestTypes) | ||
{} | ||
|
||
TEMPLATE_PRODUCT_TEST_CASE("template_product_test_case", "[cmake_integration]", TemplateStruct, int){} | ||
|
||
TEMPLATE_PRODUCT_TEST_CASE_SIG("template_product_test_case_sig", "[cmake_integration]", | ||
((int V), V), CompileTimeValue, 42) | ||
{} | ||
|
||
TEMPLATE_PRODUCT_TEST_CASE_METHOD(TemplateFixture, | ||
"template_product_test_case_method", | ||
"[cmake_integration]", | ||
TemplateStruct, int) | ||
{} | ||
|
||
TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG(TemplateFixture, | ||
"template_product_test_case_method_sig", "[cmake_integration]", | ||
((int V), V), CompileTimeValue, 42) | ||
{} | ||
|
||
TEST_CASE("test_case", "[cmake_integration]"){} | ||
|
||
TEST_CASE_METHOD(FakeFixture, "test_case_method", "[cmake_integration]"){} | ||
|
||
ANON_TEST_CASE(){} | ||
|
||
METHOD_AS_TEST_CASE(FakeFixture::fakeTest, "method_as_test_case", "[cmake_integration]") | ||
|
||
REGISTER_TEST_CASE(testFunction, "register_test_case", "[cmake_integration]") | ||
|
||
}} // namespace CMakeCTestRegistrationTests |