mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-08-19 17:49:56 +00:00
Always run the tearDown() even if test is ignored
This commit is contained in:
@@ -276,7 +276,7 @@ class UnityTestRunnerGenerator
|
|||||||
output.puts(" TestFunc(#{va_args2}); \\")
|
output.puts(" TestFunc(#{va_args2}); \\")
|
||||||
output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); } \\") if cexception
|
output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); } \\") if cexception
|
||||||
output.puts(" } \\")
|
output.puts(" } \\")
|
||||||
output.puts(" if (TEST_PROTECT() && !TEST_IS_IGNORED) \\")
|
output.puts(" if (TEST_PROTECT()) \\")
|
||||||
output.puts(" { \\")
|
output.puts(" { \\")
|
||||||
output.puts(" #{@options[:teardown_name]}(); \\")
|
output.puts(" #{@options[:teardown_name]}(); \\")
|
||||||
output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?)
|
output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?)
|
||||||
|
|||||||
+1
-1
@@ -1275,7 +1275,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
|
|||||||
setUp();
|
setUp();
|
||||||
Func();
|
Func();
|
||||||
}
|
}
|
||||||
if (TEST_PROTECT() && !(Unity.CurrentTestIgnored))
|
if (TEST_PROTECT())
|
||||||
{
|
{
|
||||||
tearDown();
|
tearDown();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,11 @@ void tearDown(void)
|
|||||||
{
|
{
|
||||||
endPutcharSpy(); /* Stop suppressing test output */
|
endPutcharSpy(); /* Stop suppressing test output */
|
||||||
if (SetToOneToFailInTearDown == 1)
|
if (SetToOneToFailInTearDown == 1)
|
||||||
|
{
|
||||||
|
/* These will be skipped internally if already failed/ignored */
|
||||||
TEST_FAIL_MESSAGE("<= Failed in tearDown");
|
TEST_FAIL_MESSAGE("<= Failed in tearDown");
|
||||||
|
TEST_IGNORE_MESSAGE("<= Ignored in tearDown");
|
||||||
|
}
|
||||||
if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0))
|
if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0))
|
||||||
{
|
{
|
||||||
UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]");
|
UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]");
|
||||||
|
|||||||
Reference in New Issue
Block a user