未验证 提交 c9b1d217 编写于 作者: M Mark VanderVoord 提交者: GitHub

Merge pull request #414 from art-of-dom/silent-unity-fixture

silent mode in unity fixture
......@@ -79,15 +79,21 @@ void UnityTestRunner(unityfunction* setup,
Unity.TestFile = file;
Unity.CurrentTestName = printableName;
Unity.CurrentTestLineNumber = line;
if (!UnityFixture.Verbose)
UNITY_OUTPUT_CHAR('.');
else
if (UnityFixture.Verbose)
{
UnityPrint(printableName);
#ifndef UNITY_REPEAT_TEST_NAME
Unity.CurrentTestName = NULL;
#endif
}
else if (UnityFixture.Silent)
{
/* Do Nothing */
}
else
{
UNITY_OUTPUT_CHAR('.');
}
Unity.NumberOfTests++;
UnityMalloc_StartTest();
......@@ -120,13 +126,19 @@ void UnityIgnoreTest(const char* printableName, const char* group, const char* n
{
Unity.NumberOfTests++;
Unity.TestIgnores++;
if (!UnityFixture.Verbose)
UNITY_OUTPUT_CHAR('!');
else
if (UnityFixture.Verbose)
{
UnityPrint(printableName);
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;
UnityFixture.Verbose = 0;
UnityFixture.Silent = 0;
UnityFixture.GroupFilter = 0;
UnityFixture.NameFilter = 0;
UnityFixture.RepeatCount = 1;
......@@ -364,6 +377,11 @@ int UnityGetCommandLineOptions(int argc, const char* argv[])
UnityFixture.Verbose = 1;
i++;
}
else if (strcmp(argv[i], "-s") == 0)
{
UnityFixture.Silent = 1;
i++;
}
else if (strcmp(argv[i], "-g") == 0)
{
i++;
......
......@@ -16,6 +16,7 @@ extern "C"
struct UNITY_FIXTURE_T
{
int Verbose;
int Silent;
unsigned int RepeatCount;
const char* NameFilter;
const char* GroupFilter;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册