@@ -334,12 +334,6 @@ CString libc_make_test_file_path_func(const char *file_name);
334334 return " [ParamType = " #TYPE " ]" ; \
335335 }
336336
337- #define DO_PRAGMA_BEGIN
338-
339- #define DO_PRAGMA
340-
341- #define DO_PRAGMA_END
342-
343337#define TYPED_TEST (SuiteName, TestName, TypeList ) \
344338 static_assert ( \
345339 LIBC_NAMESPACE::testing::internal::valid_prefix (#SuiteName), \
@@ -356,12 +350,9 @@ CString libc_make_test_file_path_func(const char *file_name);
356350 } \
357351 void Run () override ; \
358352 const char *getName () const override { return name; } \
353+ static TypeList::Tests<SuiteName##_##TestName>::type \
354+ SuiteName##_##TestName##_Instance; \
359355 }; \
360- DO_PRAGMA_BEGIN \
361- DO_PRAGMA \
362- TypeList::Tests<SuiteName##_##TestName>::type \
363- SuiteName##_##TestName##_Instance; \
364- DO_PRAGMA_END \
365356 template <typename T> void SuiteName##_##TestName<T>::Run()
366357
367358#define TYPED_TEST_F (SuiteClass, TestName, TypeList ) \
@@ -379,12 +370,9 @@ CString libc_make_test_file_path_func(const char *file_name);
379370 } \
380371 void Run () override ; \
381372 const char *getName () const override { return name; } \
373+ static TypeList::Tests<SuiteClass##_##TestName>::type \
374+ SuiteClass##_##TestName##_Instance; \
382375 }; \
383- DO_PRAGMA_BEGIN \
384- DO_PRAGMA \
385- TypeList::Tests<SuiteClass##_##TestName>::type \
386- SuiteClass##_##TestName##_Instance; \
387- DO_PRAGMA_END \
388376 template <typename T> void SuiteClass##_##TestName<T>::Run()
389377
390378#define TEST (SuiteName, TestName ) \
@@ -395,11 +383,8 @@ CString libc_make_test_file_path_func(const char *file_name);
395383 SuiteName##_##TestName() { addTest (this ); } \
396384 void Run () override ; \
397385 const char *getName () const override { return #SuiteName " ." #TestName; } \
386+ static SuiteName##_##TestName SuiteName##_##TestName##_Instance; \
398387 }; \
399- DO_PRAGMA_BEGIN \
400- DO_PRAGMA \
401- SuiteName##_##TestName SuiteName##_##TestName##_Instance; \
402- DO_PRAGMA_END \
403388 void SuiteName##_##TestName::Run()
404389
405390#define TEST_F (SuiteClass, TestName ) \
@@ -411,11 +396,8 @@ CString libc_make_test_file_path_func(const char *file_name);
411396 SuiteClass##_##TestName() { addTest (this ); } \
412397 void Run () override ; \
413398 const char *getName () const override { return #SuiteClass " ." #TestName; } \
399+ static SuiteClass##_##TestName SuiteClass##_##TestName##_Instance; \
414400 }; \
415- DO_PRAGMA_BEGIN \
416- DO_PRAGMA \
417- SuiteClass##_##TestName SuiteClass##_##TestName##_Instance; \
418- DO_PRAGMA_END \
419401 void SuiteClass##_##TestName::Run()
420402
421403// Helper to trick the compiler into ignoring lack of braces on the else
0 commit comments