Skip to content
Merged
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
14 changes: 14 additions & 0 deletions components/utilities/utest/utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,16 @@ static void utest_do_run(const char *utest_name)
}
is_find = RT_TRUE;

rt_bool_t tc_failed = RT_FALSE;

LOG_I("[----------] [ testcase ] (%s) started", tc_table[i].name);
if (tc_table[i].init != RT_NULL)
{
if (tc_table[i].init() != RT_EOK)
{
TC_FAIL_LIST_MARK_FAILED(i);
tc_fail_num ++;
tc_failed = RT_TRUE;
LOG_E("[ FAILED ] [ result ] testcase init (%s)", tc_table[i].name);
goto __tc_continue;
}
Expand All @@ -283,18 +288,27 @@ static void utest_do_run(const char *utest_name)
{
TC_FAIL_LIST_MARK_FAILED(i);
tc_fail_num ++;
tc_failed = RT_TRUE;
LOG_E("[ FAILED ] [ result ] testcase (%s)", tc_table[i].name);
}
}
else
{
TC_FAIL_LIST_MARK_FAILED(i);
tc_fail_num ++;
tc_failed = RT_TRUE;
LOG_E("[ FAILED ] [ result ] testcase (%s)", tc_table[i].name);
}

if (tc_table[i].cleanup != RT_NULL)
{
if (tc_table[i].cleanup() != RT_EOK)
{
if (tc_failed == RT_FALSE)
{
TC_FAIL_LIST_MARK_FAILED(i);
tc_fail_num ++;
}
LOG_E("[ FAILED ] [ result ] testcase cleanup (%s)", tc_table[i].name);
goto __tc_continue;
}
Expand Down
Loading