Skip to content

Commit

Permalink
Merge pull request #409 from art-of-dom/unity_fixture_colour_fix
Browse files Browse the repository at this point in the history
Use Pass string from unity.c in unity_fixture.c to garuntee colour behavior
  • Loading branch information
mvandervoord committed Apr 13, 2019
2 parents 480d505 + 0bd6bf7 commit f51e658
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion extras/fixture/src/unity_fixture.c
Expand Up @@ -419,7 +419,8 @@ void UnityConcludeFixtureTest(void)
{
if (UnityFixture.Verbose)
{
UnityPrint(" PASS");
UnityPrint(" ");
UnityPrint(UnityStrPass);
UNITY_EXEC_TIME_STOP();
UNITY_PRINT_EXEC_TIME();
UNITY_PRINT_EOL();
Expand Down
16 changes: 8 additions & 8 deletions src/unity.c
Expand Up @@ -21,15 +21,15 @@ void UNITY_OUTPUT_CHAR(int);
struct UNITY_STORAGE_T Unity;

#ifdef UNITY_OUTPUT_COLOR
static const char UnityStrOk[] = "\033[42mOK\033[00m";
static const char UnityStrPass[] = "\033[42mPASS\033[00m";
static const char UnityStrFail[] = "\033[41mFAIL\033[00m";
static const char UnityStrIgnore[] = "\033[43mIGNORE\033[00m";
const char UnityStrOk[] = "\033[42mOK\033[00m";
const char UnityStrPass[] = "\033[42mPASS\033[00m";
const char UnityStrFail[] = "\033[41mFAIL\033[00m";
const char UnityStrIgnore[] = "\033[43mIGNORE\033[00m";
#else
static const char UnityStrOk[] = "OK";
static const char UnityStrPass[] = "PASS";
static const char UnityStrFail[] = "FAIL";
static const char UnityStrIgnore[] = "IGNORE";
const char UnityStrOk[] = "OK";
const char UnityStrPass[] = "PASS";
const char UnityStrFail[] = "FAIL";
const char UnityStrIgnore[] = "IGNORE";
#endif
static const char UnityStrNull[] = "NULL";
static const char UnityStrSpacer[] = ". ";
Expand Down
5 changes: 5 additions & 0 deletions src/unity_internals.h
Expand Up @@ -639,6 +639,11 @@ UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num);
* Error Strings We Might Need
*-------------------------------------------------------*/

extern const char UnityStrOk[];
extern const char UnityStrPass[];
extern const char UnityStrFail[];
extern const char UnityStrIgnore[];

extern const char UnityStrErrFloat[];
extern const char UnityStrErrDouble[];
extern const char UnityStrErr64[];
Expand Down

0 comments on commit f51e658

Please sign in to comment.