提交 9e9adc05 编写于 作者: N Nimrod Zimerman

Bug fix - ignored tests were incorrectly counted when not selected for running.

Ignored tests are now correctly skipped if not selected by test name or
by group name.
上级 6a944c2e
...@@ -115,15 +115,18 @@ void UnityTestRunner(unityfunction* setup, ...@@ -115,15 +115,18 @@ void UnityTestRunner(unityfunction* setup,
} }
} }
void UnityIgnoreTest(const char * printableName) void UnityIgnoreTest(const char * printableName, const char * group, const char * name)
{ {
Unity.NumberOfTests++; if (testSelected(name) && groupSelected(group))
Unity.CurrentTestIgnored = 1; {
if (!UnityFixture.Verbose) Unity.NumberOfTests++;
UNITY_OUTPUT_CHAR('!'); Unity.CurrentTestIgnored = 1;
else if (!UnityFixture.Verbose)
UnityPrint(printableName); UNITY_OUTPUT_CHAR('!');
UnityConcludeFixtureTest(); else
UnityPrint(printableName);
UnityConcludeFixtureTest();
}
} }
......
...@@ -45,7 +45,7 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)); ...@@ -45,7 +45,7 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void));
void TEST_##group##_##name##_run(void);\ void TEST_##group##_##name##_run(void);\
void TEST_##group##_##name##_run(void)\ void TEST_##group##_##name##_run(void)\
{\ {\
UnityIgnoreTest("IGNORE_TEST(" #group ", " #name ")");\ UnityIgnoreTest("IGNORE_TEST(" #group ", " #name ")", TEST_GROUP_##group, #name);\
}\ }\
void TEST_##group##_##name##_(void) void TEST_##group##_##name##_(void)
......
...@@ -25,7 +25,7 @@ void UnityTestRunner(unityfunction * setup, ...@@ -25,7 +25,7 @@ void UnityTestRunner(unityfunction * setup,
const char * name, const char * name,
const char * file, int line); const char * file, int line);
void UnityIgnoreTest(const char * printableName); void UnityIgnoreTest(const char * printableName, const char * group, const char * name);
void UnityMalloc_StartTest(void); void UnityMalloc_StartTest(void);
void UnityMalloc_EndTest(void); void UnityMalloc_EndTest(void);
int UnityFailureCount(void); int UnityFailureCount(void);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册