|
22 | 22 | #pragma GCC diagnostic ignored "-Wunused-variable" |
23 | 23 | #endif |
24 | 24 |
|
| 25 | +#ifdef CATCH_CONFIG_NAME_SEPARATOR |
| 26 | +#define INTERNAL_CATCH_CONFIG_NAME_SEPARATOR CATCH_CONFIG_NAME_SEPARATOR |
| 27 | +#else |
| 28 | +#define INTERNAL_CATCH_CONFIG_NAME_SEPARATOR " - " |
| 29 | +#endif |
| 30 | + |
25 | 31 | #if defined(CATCH_CONFIG_DISABLE) |
26 | 32 | #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( TestName, TestFunc, Name, Tags, Signature, ... ) \ |
27 | 33 | INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature)) |
|
87 | 93 | size_t index = 0; \ |
88 | 94 | constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; /* NOLINT(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,hicpp-avoid-c-arrays) */\ |
89 | 95 | using expander = size_t[]; /* NOLINT(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,hicpp-avoid-c-arrays) */\ |
90 | | - (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ |
| 96 | + (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name INTERNAL_CATCH_CONFIG_NAME_SEPARATOR + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ |
91 | 97 | }\ |
92 | 98 | };\ |
93 | 99 | static const int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ |
|
135 | 141 | constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ |
136 | 142 | constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ |
137 | 143 | constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ |
138 | | - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */\ |
| 144 | + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name INTERNAL_CATCH_CONFIG_NAME_SEPARATOR + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */\ |
139 | 145 | } \ |
140 | 146 | }; \ |
141 | 147 | static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ |
|
181 | 187 | void reg_tests() { \ |
182 | 188 | size_t index = 0; \ |
183 | 189 | using expander = size_t[]; \ |
184 | | - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\ |
| 190 | + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name INTERNAL_CATCH_CONFIG_NAME_SEPARATOR INTERNAL_CATCH_STRINGIZE(TmplList) INTERNAL_CATCH_CONFIG_NAME_SEPARATOR + std::to_string(index), Tags } ), index++)... };/* NOLINT */\ |
185 | 191 | } \ |
186 | 192 | };\ |
187 | 193 | static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ |
|
217 | 223 | size_t index = 0; \ |
218 | 224 | constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\ |
219 | 225 | using expander = size_t[];\ |
220 | | - (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ |
| 226 | + (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name INTERNAL_CATCH_CONFIG_NAME_SEPARATOR + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \ |
221 | 227 | }\ |
222 | 228 | };\ |
223 | 229 | static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ |
|
267 | 273 | constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ |
268 | 274 | constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ |
269 | 275 | constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ |
270 | | - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */ \ |
| 276 | + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name INTERNAL_CATCH_CONFIG_NAME_SEPARATOR + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */ \ |
271 | 277 | }\ |
272 | 278 | };\ |
273 | 279 | static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ |
|
316 | 322 | void reg_tests(){\ |
317 | 323 | size_t index = 0;\ |
318 | 324 | using expander = size_t[];\ |
319 | | - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName##_catch_sr, Catch::NameAndTags{ Name " - " INTERNAL_CATCH_STRINGIZE(TmplList) " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \ |
| 325 | + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName##_catch_sr, Catch::NameAndTags{ Name INTERNAL_CATCH_CONFIG_NAME_SEPARATOR INTERNAL_CATCH_STRINGIZE(TmplList) INTERNAL_CATCH_CONFIG_NAME_SEPARATOR + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \ |
320 | 326 | }\ |
321 | 327 | };\ |
322 | 328 | static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ |
|
0 commit comments