diff --git a/docs/UnityConfigurationGuide.md b/docs/UnityConfigurationGuide.md index e8e415fb8614441454a4943e450a4730236471e0..8155a0f6215f1d70d54b572de73de84d551f30c0 100644 --- a/docs/UnityConfigurationGuide.md +++ b/docs/UnityConfigurationGuide.md @@ -343,6 +343,18 @@ _Note:_ specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required. +##### `UNITY_OUTPUT_FOR_ECLIPSE` + +##### `UNITY_OUTPUT_FOR_IAR_WORKBENCH` + +##### `UNITY_OUTPUT_FOR_QT_CREATOR` + +When managing your own builds, it is often handy to have messages output in a format which is +recognized by your IDE. These are some standard formats which can be supported. If you're using +Ceedling to manage your builds, it is better to stick with the standard format (leaving these +all undefined) and allow Ceedling to use its own decorators. + + ##### `UNITY_PTR_ATTRIBUTE` Some compilers require a custom attribute to be assigned to pointers, like diff --git a/src/unity.c b/src/unity.c index bcc0283aa79b3a60cba1e4b3aca51a26c02fe694..9b80605e53bd3506bed4b93a4c3e1583427f14ad 100644 --- a/src/unity.c +++ b/src/unity.c @@ -570,12 +570,44 @@ void UnityPrintFloat(const UNITY_DOUBLE input_number) /*-----------------------------------------------*/ static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) { +#ifdef UNITY_OUTPUT_FOR_ECLIPSE + UNITY_OUTPUT_CHAR('('); UnityPrint(file); UNITY_OUTPUT_CHAR(':'); UnityPrintNumber((UNITY_INT)line); + UNITY_OUTPUT_CHAR(')'); + UNITY_OUTPUT_CHAR(' '); + UnityPrint(Unity.CurrentTestName); + UNITY_OUTPUT_CHAR(':'); +#else +#ifdef UNITY_OUTPUT_FOR_IAR_WORKBENCH + UnityPrint("'); + UnityPrint(Unity.CurrentTestName); + UnityPrint(" "); +#else +#ifdef UNITY_OUTPUT_FOR_QT_CREATOR + UnityPrint("file://"); + UnityPrint(file); UNITY_OUTPUT_CHAR(':'); + UnityPrintNumber((UNITY_INT)line); + UNITY_OUTPUT_CHAR(' '); UnityPrint(Unity.CurrentTestName); UNITY_OUTPUT_CHAR(':'); +#else + UnityPrint(file); + UNITY_OUTPUT_CHAR(':'); + UnityPrintNumber((UNITY_INT)line); + UNITY_OUTPUT_CHAR(':'); + UnityPrint(Unity.CurrentTestName); + UNITY_OUTPUT_CHAR(':'); +#endif +#endif +#endif } /*-----------------------------------------------*/