TC: clear the TC_STAT_RUNNING flag when tc forgot to do so

TCs are supposed to exit with the TC_STAT_RUNNING cleared. If it forgot
to do this, do it by ourselves.
This commit is contained in:
Grissiom 2013-12-19 14:41:16 +08:00
parent 52db5cfbe0
commit bf640015e6
1 changed files with 9 additions and 0 deletions

View File

@ -52,6 +52,15 @@ void tc_thread_entry(void* parameter)
_tc_cleanup = RT_NULL;
}
if (_tc_stat & TC_STAT_RUNNING)
{
rt_kprintf("TestCase[%s] exit with stat TC_STAT_RUNNING."
" Please fix the TC.\n",
_tc_current);
/* If the TC forgot to clear the flag, we do it. */
_tc_stat &= ~TC_STAT_RUNNING;
}
if (_tc_stat & TC_STAT_FAILED)
rt_kprintf("TestCase[%s] failed\n", _tc_current);
else