diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index 134be65e59f7fb8027420036ef219b11c8560625..8e8e5bbc0d378e1a8a45dd48528d09d2a752dbb1 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -276,7 +276,7 @@ class UnityTestRunnerGenerator output.puts(" TestFunc(#{va_args2}); \\") output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); } \\") if cexception output.puts(" } \\") - output.puts(" if (TEST_PROTECT() && !TEST_IS_IGNORED) \\") + output.puts(" if (TEST_PROTECT()) \\") output.puts(" { \\") output.puts(" #{@options[:teardown_name]}(); \\") output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?) diff --git a/src/unity.c b/src/unity.c index c755ebb367234d7053eca97131d99d5c80193546..1255af561181db04d0b8168d5af4c2944ecaec9d 100644 --- a/src/unity.c +++ b/src/unity.c @@ -1275,7 +1275,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int setUp(); Func(); } - if (TEST_PROTECT() && !(Unity.CurrentTestIgnored)) + if (TEST_PROTECT()) { tearDown(); } diff --git a/test/tests/testunity.c b/test/tests/testunity.c index 08c621af3425036feb14ba0d60ed0b6a5c1cec41..bab24dc16764ceca3470e38221ee9104bce64199 100644 --- a/test/tests/testunity.c +++ b/test/tests/testunity.c @@ -67,7 +67,11 @@ void tearDown(void) { endPutcharSpy(); /* Stop suppressing test output */ if (SetToOneToFailInTearDown == 1) + { + /* These will be skipped internally if already failed/ignored */ TEST_FAIL_MESSAGE("<= Failed in tearDown"); + TEST_IGNORE_MESSAGE("<= Ignored in tearDown"); + } if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0)) { UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]");