mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-28 02:47:06 +08:00
TC: print a summary after all the tests
This commit is contained in:
parent
ca270a4667
commit
6b02886eb3
@ -20,6 +20,7 @@ FINSH_VAR_EXPORT(_tc_scale, finsh_type_int, the testcase timer timeout scale)
|
|||||||
|
|
||||||
void tc_thread_entry(void* parameter)
|
void tc_thread_entry(void* parameter)
|
||||||
{
|
{
|
||||||
|
unsigned int fail_count = 0;
|
||||||
struct finsh_syscall* index;
|
struct finsh_syscall* index;
|
||||||
|
|
||||||
/* create tc semaphore */
|
/* create tc semaphore */
|
||||||
@ -62,14 +63,27 @@ void tc_thread_entry(void* parameter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_tc_stat & TC_STAT_FAILED)
|
if (_tc_stat & TC_STAT_FAILED)
|
||||||
|
{
|
||||||
rt_kprintf("TestCase[%s] failed\n", _tc_current);
|
rt_kprintf("TestCase[%s] failed\n", _tc_current);
|
||||||
|
fail_count++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
rt_kprintf("TestCase[%s] passed\n", _tc_current);
|
rt_kprintf("TestCase[%s] passed\n", _tc_current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rt_kprintf("RT-Thread TestCase Running Done!\n");
|
rt_kprintf("RT-Thread TestCase Running Done!\n");
|
||||||
|
if (fail_count)
|
||||||
|
{
|
||||||
|
rt_kprintf("%d tests failed\n", fail_count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rt_kprintf("All tests passed\n");
|
||||||
|
}
|
||||||
/* detach tc semaphore */
|
/* detach tc semaphore */
|
||||||
rt_sem_detach(&_tc_sem);
|
rt_sem_detach(&_tc_sem);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user