1
0
mirror of https://github.com/ThrowTheSwitch/Unity synced 2025-05-16 01:39:33 -04:00

Merge pull request from AlariOis/master

More elegant RUN_TEST macro
This commit is contained in:
Mark VanderVoord 2020-05-02 14:36:03 -04:00 committed by GitHub
commit c5413ce16b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -701,11 +701,8 @@ extern const char UnityStrErrShorthand[];
#endif
#endif
#ifdef UNITY_SUPPORT_VARIADIC_MACROS
#define RUN_TEST(...) UnityDefaultTestRun(RUN_TEST_FIRST(__VA_ARGS__), RUN_TEST_SECOND(__VA_ARGS__))
#define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(__VA_ARGS__, throwaway)
#define RUN_TEST_FIRST_HELPER(first, ...) (first), #first
#define RUN_TEST_SECOND(...) RUN_TEST_SECOND_HELPER(__VA_ARGS__, __LINE__, throwaway)
#define RUN_TEST_SECOND_HELPER(first, second, ...) (second)
#define RUN_TEST(...) RUN_TEST_AT_LINE(__VA_ARGS__, __LINE__)
#define RUN_TEST_AT_LINE(func, line, ...) UnityDefaultTestRun(func, #func, line)
#endif
#endif