mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-29 03:04:27 +01:00
Transform plain macro into a function macro, UNITY_PRINT_EOL()
This helps clarity and is more obvious, it looks like a print function
This commit is contained in:
@@ -28,7 +28,7 @@ static void announceTestRun(unsigned int runNumber)
|
|||||||
UnityPrintNumber(runNumber+1);
|
UnityPrintNumber(runNumber+1);
|
||||||
UnityPrint(" of ");
|
UnityPrint(" of ");
|
||||||
UnityPrintNumber(UnityFixture.RepeatCount);
|
UnityPrintNumber(UnityFixture.RepeatCount);
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
|
int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
|
||||||
@@ -43,7 +43,7 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void))
|
|||||||
UnityBegin(argv[0]);
|
UnityBegin(argv[0]);
|
||||||
announceTestRun(r);
|
announceTestRun(r);
|
||||||
runAllTests();
|
runAllTests();
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
UnityEnd();
|
UnityEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +396,7 @@ void UnityConcludeFixtureTest(void)
|
|||||||
{
|
{
|
||||||
//if (UnityFixture.Verbose)
|
//if (UnityFixture.Verbose)
|
||||||
//{
|
//{
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
//}
|
//}
|
||||||
Unity.TestIgnores++;
|
Unity.TestIgnores++;
|
||||||
}
|
}
|
||||||
@@ -405,13 +405,13 @@ void UnityConcludeFixtureTest(void)
|
|||||||
if (UnityFixture.Verbose)
|
if (UnityFixture.Verbose)
|
||||||
{
|
{
|
||||||
UnityPrint(" PASS");
|
UnityPrint(" PASS");
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Unity.CurrentTestFailed)
|
else if (Unity.CurrentTestFailed)
|
||||||
{
|
{
|
||||||
Unity.TestFailures++;
|
Unity.TestFailures++;
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
Unity.CurrentTestFailed = 0;
|
Unity.CurrentTestFailed = 0;
|
||||||
|
|||||||
10
src/unity.c
10
src/unity.c
@@ -355,7 +355,7 @@ void UnityConcludeTest(void)
|
|||||||
|
|
||||||
Unity.CurrentTestFailed = 0;
|
Unity.CurrentTestFailed = 0;
|
||||||
Unity.CurrentTestIgnored = 0;
|
Unity.CurrentTestIgnored = 0;
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
@@ -1272,16 +1272,16 @@ void UnityBegin(const char* filename)
|
|||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
int UnityEnd(void)
|
int UnityEnd(void)
|
||||||
{
|
{
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
UnityPrint(UnityStrBreaker);
|
UnityPrint(UnityStrBreaker);
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
UnityPrintNumber((_U_SINT)(Unity.NumberOfTests));
|
UnityPrintNumber((_U_SINT)(Unity.NumberOfTests));
|
||||||
UnityPrint(UnityStrResultsTests);
|
UnityPrint(UnityStrResultsTests);
|
||||||
UnityPrintNumber((_U_SINT)(Unity.TestFailures));
|
UnityPrintNumber((_U_SINT)(Unity.TestFailures));
|
||||||
UnityPrint(UnityStrResultsFailures);
|
UnityPrint(UnityStrResultsFailures);
|
||||||
UnityPrintNumber((_U_SINT)(Unity.TestIgnores));
|
UnityPrintNumber((_U_SINT)(Unity.TestIgnores));
|
||||||
UnityPrint(UnityStrResultsIgnored);
|
UnityPrint(UnityStrResultsIgnored);
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
if (Unity.TestFailures == 0U)
|
if (Unity.TestFailures == 0U)
|
||||||
{
|
{
|
||||||
UnityPrintOk();
|
UnityPrintOk();
|
||||||
@@ -1290,7 +1290,7 @@ int UnityEnd(void)
|
|||||||
{
|
{
|
||||||
UnityPrintFail();
|
UnityPrintFail();
|
||||||
}
|
}
|
||||||
UNITY_PRINT_EOL;
|
UNITY_PRINT_EOL();
|
||||||
UNITY_OUTPUT_COMPLETE();
|
UNITY_OUTPUT_COMPLETE();
|
||||||
return (int)(Unity.TestFailures);
|
return (int)(Unity.TestFailures);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ extern int UNITY_OUTPUT_CHAR(int);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef UNITY_PRINT_EOL
|
#ifndef UNITY_PRINT_EOL
|
||||||
#define UNITY_PRINT_EOL UNITY_OUTPUT_CHAR('\n')
|
#define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n')
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef UNITY_OUTPUT_START
|
#ifndef UNITY_OUTPUT_START
|
||||||
|
|||||||
Reference in New Issue
Block a user