From fd80d514ee6b17a54bee29eaa5225ca25eef5ea9 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Sun, 3 May 2020 08:57:21 -0400 Subject: [PATCH] Revert "More elegant RUN_TEST macro" This reverts commit cdfb7e092ccb3cb1080486dd0d78bc713b7317da. --- src/unity_internals.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/unity_internals.h b/src/unity_internals.h index 3ba153b4..d7c2116c 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -701,8 +701,11 @@ extern const char UnityStrErrShorthand[]; #endif #endif #ifdef UNITY_SUPPORT_VARIADIC_MACROS -#define RUN_TEST(...) RUN_TEST_AT_LINE(__VA_ARGS__, __LINE__) -#define RUN_TEST_AT_LINE(func, line, ...) UnityDefaultTestRun(func, #func, line) +#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) #endif #endif