mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-21 23:00:52 +08:00
silent mode in unity fixture
This commit is contained in:
@ -79,15 +79,21 @@ void UnityTestRunner(unityfunction* setup,
|
|||||||
Unity.TestFile = file;
|
Unity.TestFile = file;
|
||||||
Unity.CurrentTestName = printableName;
|
Unity.CurrentTestName = printableName;
|
||||||
Unity.CurrentTestLineNumber = line;
|
Unity.CurrentTestLineNumber = line;
|
||||||
if (!UnityFixture.Verbose)
|
if (UnityFixture.Verbose)
|
||||||
UNITY_OUTPUT_CHAR('.');
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
UnityPrint(printableName);
|
UnityPrint(printableName);
|
||||||
#ifndef UNITY_REPEAT_TEST_NAME
|
#ifndef UNITY_REPEAT_TEST_NAME
|
||||||
Unity.CurrentTestName = NULL;
|
Unity.CurrentTestName = NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else if (UnityFixture.Silent)
|
||||||
|
{
|
||||||
|
/* Do Nothing */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UNITY_OUTPUT_CHAR('.');
|
||||||
|
}
|
||||||
|
|
||||||
Unity.NumberOfTests++;
|
Unity.NumberOfTests++;
|
||||||
UnityMalloc_StartTest();
|
UnityMalloc_StartTest();
|
||||||
@ -120,13 +126,19 @@ void UnityIgnoreTest(const char* printableName, const char* group, const char* n
|
|||||||
{
|
{
|
||||||
Unity.NumberOfTests++;
|
Unity.NumberOfTests++;
|
||||||
Unity.TestIgnores++;
|
Unity.TestIgnores++;
|
||||||
if (!UnityFixture.Verbose)
|
if (UnityFixture.Verbose)
|
||||||
UNITY_OUTPUT_CHAR('!');
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
UnityPrint(printableName);
|
UnityPrint(printableName);
|
||||||
UNITY_PRINT_EOL();
|
UNITY_PRINT_EOL();
|
||||||
}
|
}
|
||||||
|
else if (UnityFixture.Silent)
|
||||||
|
{
|
||||||
|
/* Do Nothing */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UNITY_OUTPUT_CHAR('!');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,6 +362,7 @@ int UnityGetCommandLineOptions(int argc, const char* argv[])
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
UnityFixture.Verbose = 0;
|
UnityFixture.Verbose = 0;
|
||||||
|
UnityFixture.Silent = 0;
|
||||||
UnityFixture.GroupFilter = 0;
|
UnityFixture.GroupFilter = 0;
|
||||||
UnityFixture.NameFilter = 0;
|
UnityFixture.NameFilter = 0;
|
||||||
UnityFixture.RepeatCount = 1;
|
UnityFixture.RepeatCount = 1;
|
||||||
@ -364,6 +377,11 @@ int UnityGetCommandLineOptions(int argc, const char* argv[])
|
|||||||
UnityFixture.Verbose = 1;
|
UnityFixture.Verbose = 1;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[i], "-s") == 0)
|
||||||
|
{
|
||||||
|
UnityFixture.Silent = 1;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
else if (strcmp(argv[i], "-g") == 0)
|
else if (strcmp(argv[i], "-g") == 0)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
|
@ -16,6 +16,7 @@ extern "C"
|
|||||||
struct UNITY_FIXTURE_T
|
struct UNITY_FIXTURE_T
|
||||||
{
|
{
|
||||||
int Verbose;
|
int Verbose;
|
||||||
|
int Silent;
|
||||||
unsigned int RepeatCount;
|
unsigned int RepeatCount;
|
||||||
const char* NameFilter;
|
const char* NameFilter;
|
||||||
const char* GroupFilter;
|
const char* GroupFilter;
|
||||||
|
Reference in New Issue
Block a user