diff options
| author | Grissiom <[email protected]> | 2013-12-19 14:41:16 +0800 |
|---|---|---|
| committer | Grissiom <[email protected]> | 2013-12-20 10:23:31 +0800 |
| commit | bf640015e644ef2ba65a04310f8965ba3c906af2 (patch) | |
| tree | c5a38105ec0eadae204784c6f887d727a823fdba /examples/kernel | |
| parent | 52db5cfbe035c5751c178626afe7f8be7743d35e (diff) | |
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.
Diffstat (limited to 'examples/kernel')
| -rw-r--r-- | examples/kernel/tc_comm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/kernel/tc_comm.c b/examples/kernel/tc_comm.c index 7804701284..ac4b36d8be 100644 --- a/examples/kernel/tc_comm.c +++ b/examples/kernel/tc_comm.c @@ -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 |
