mirror of
https://github.com/catchorg/Catch2.git
synced 2025-02-17 03:43:29 +01:00
parent
d30f1dda02
commit
d13e094598
@ -120,7 +120,6 @@ struct AutoReg : NonCopyable {
|
|||||||
struct TestName{\
|
struct TestName{\
|
||||||
template<typename...Ts> \
|
template<typename...Ts> \
|
||||||
TestName(Ts...names){\
|
TestName(Ts...names){\
|
||||||
CATCH_INTERNAL_CHECK_UNIQUE_TYPES(CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \
|
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
@ -131,12 +130,6 @@ struct AutoReg : NonCopyable {
|
|||||||
template<typename TestType> \
|
template<typename TestType> \
|
||||||
static void TestFunc()
|
static void TestFunc()
|
||||||
|
|
||||||
#if defined(CATCH_CPP17_OR_GREATER)
|
|
||||||
#define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) static_assert(Catch::is_unique<__VA_ARGS__>,"Duplicate type detected in declaration of template test case");
|
|
||||||
#else
|
|
||||||
#define CATCH_INTERNAL_CHECK_UNIQUE_TYPES(...) static_assert(Catch::is_unique<__VA_ARGS__>::value,"Duplicate type detected in declaration of template test case");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
|
#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
|
||||||
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
|
#define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
|
||||||
INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ )
|
INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, __VA_ARGS__ )
|
||||||
@ -158,7 +151,6 @@ struct AutoReg : NonCopyable {
|
|||||||
template<typename... Types> \
|
template<typename... Types> \
|
||||||
struct TestName { \
|
struct TestName { \
|
||||||
TestName() { \
|
TestName() { \
|
||||||
CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...) \
|
|
||||||
int index = 0; \
|
int index = 0; \
|
||||||
using expander = int[]; \
|
using expander = int[]; \
|
||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
||||||
@ -197,7 +189,6 @@ struct AutoReg : NonCopyable {
|
|||||||
struct TestNameClass{\
|
struct TestNameClass{\
|
||||||
template<typename...Ts> \
|
template<typename...Ts> \
|
||||||
TestNameClass(Ts...names){\
|
TestNameClass(Ts...names){\
|
||||||
CATCH_INTERNAL_CHECK_UNIQUE_TYPES(CATCH_REC_LIST(INTERNAL_CATCH_REMOVE_PARENS, __VA_ARGS__)) \
|
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \
|
(void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ names, Tags } ), 0)... };/* NOLINT */ \
|
||||||
}\
|
}\
|
||||||
@ -226,7 +217,6 @@ struct AutoReg : NonCopyable {
|
|||||||
template<typename...Types>\
|
template<typename...Types>\
|
||||||
struct TestNameClass{\
|
struct TestNameClass{\
|
||||||
TestNameClass(){\
|
TestNameClass(){\
|
||||||
CATCH_INTERNAL_CHECK_UNIQUE_TYPES(Types...)\
|
|
||||||
int index = 0;\
|
int index = 0;\
|
||||||
using expander = int[];\
|
using expander = int[];\
|
||||||
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
|
||||||
|
Loading…
Reference in New Issue
Block a user