1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00

Implement macro TEST_PRINTF: Works like TEST_MESSAGE, but with a format-string.

Depends on UnityPrintFormatted (define UNITY_INCLUDE_PRINT_FORMATTED).
UnityPrintFormatted has been renamed to UnityPrintF due to changes below.

API of UnityPrintFormatted has been changed (hence the rename), but end users
(developers) can use the TEST_PRINTF as an almost-drop-in replacement TEST_PRINTF
is compatible with the old UnityPrintFormatted API (see below).

The behaviour of UnityPrintF has also been changed:
  - Now it prefixes the outout with test location information Output is marked
    as INFO.
  - It adds an EOL.

Both behaviours adopted from other output functions.
This commit is contained in:
Jørn Villesen Christensen
2020-02-14 12:31:53 +01:00
parent c101cfa7d2
commit 3da0b4652c
3 changed files with 131 additions and 116 deletions

View File

@@ -515,7 +515,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
void UnityPrint(const char* string);
#ifdef UNITY_INCLUDE_PRINT_FORMATTED
void UnityPrintFormatted(const char* format, ...);
void UnityPrintF(const UNITY_LINE_TYPE line, const char* format, ...);
#endif
void UnityPrintLen(const char* string, const UNITY_UINT32 length);