mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-26 03:17:59 +08:00
Merge pull request #213 from jsalling/feature/simplify-testunity-output
Suppress output of FAIL messages that are expected during testing Unity itself. (This one makes me so happy! Thanks!)
This commit is contained in:
@ -19,11 +19,13 @@ static const _UD d_zero = 0.0;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EXPECT_ABORT_BEGIN \
|
#define EXPECT_ABORT_BEGIN \
|
||||||
|
startPutcharSpy(); \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{
|
{
|
||||||
|
|
||||||
#define VERIFY_FAILS_END \
|
#define VERIFY_FAILS_END \
|
||||||
} \
|
} \
|
||||||
|
endPutcharSpy(); /* start/end Spy to suppress output of failure message */ \
|
||||||
Unity.CurrentTestFailed = (Unity.CurrentTestFailed == 1) ? 0 : 1; \
|
Unity.CurrentTestFailed = (Unity.CurrentTestFailed == 1) ? 0 : 1; \
|
||||||
if (Unity.CurrentTestFailed == 1) { \
|
if (Unity.CurrentTestFailed == 1) { \
|
||||||
SetToOneMeanWeAlreadyCheckedThisGuy = 1; \
|
SetToOneMeanWeAlreadyCheckedThisGuy = 1; \
|
||||||
@ -36,6 +38,7 @@ static const _UD d_zero = 0.0;
|
|||||||
|
|
||||||
#define VERIFY_IGNORES_END \
|
#define VERIFY_IGNORES_END \
|
||||||
} \
|
} \
|
||||||
|
endPutcharSpy(); /* start/end Spy to suppress output of ignore message */ \
|
||||||
Unity.CurrentTestFailed = (Unity.CurrentTestIgnored == 1) ? 0 : 1; \
|
Unity.CurrentTestFailed = (Unity.CurrentTestIgnored == 1) ? 0 : 1; \
|
||||||
Unity.CurrentTestIgnored = 0; \
|
Unity.CurrentTestIgnored = 0; \
|
||||||
if (Unity.CurrentTestFailed == 1) { \
|
if (Unity.CurrentTestFailed == 1) { \
|
||||||
@ -47,6 +50,11 @@ static const _UD d_zero = 0.0;
|
|||||||
UNITY_OUTPUT_CHAR('\n'); \
|
UNITY_OUTPUT_CHAR('\n'); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void startPutcharSpy(void);
|
||||||
|
void endPutcharSpy(void);
|
||||||
|
char* getBufferPutcharSpy(void);
|
||||||
|
void putcharSpy(int c);
|
||||||
|
|
||||||
static int SetToOneToFailInTearDown;
|
static int SetToOneToFailInTearDown;
|
||||||
static int SetToOneMeanWeAlreadyCheckedThisGuy;
|
static int SetToOneMeanWeAlreadyCheckedThisGuy;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user