Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/unity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,13 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
if (TEST_PROTECT())
{
setUp();
Func();
if (CATCH_TEST_FAIL()) {
UnityTestResultsFailBegin(42);
UnityAddMsgIfSpecified("TEST_FAIL called");
UNITY_FAIL_AND_BAIL;
} else {
Func();
}
}
if (TEST_PROTECT() && !(Unity.CurrentTestIgnored))
{
Expand Down
1 change: 1 addition & 0 deletions src/unity.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ extern jmp_buf __unity_exp_buf__;
#define TEST_CATCH } else {
#define TEST_ETRY } } while(0)
#define TEST_THROW longjmp(__unity_exp_buf__, 1)
#define CATCH_TEST_FAIL() (setjmp(__unity_exp_buf__) != 0)

// Refactor to make this easier to manage
#define TEST_SHOULD_CATCH_ASSERT(actual) \
Expand Down