MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / utest_do_run

Function utest_do_run

components/utilities/utest/utest.c:221–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221static void utest_do_run(const char *utest_name)
222{
223 rt_size_t i;
224 rt_uint32_t index;
225 rt_bool_t is_find;
226 rt_uint32_t tc_fail_num = 0;
227 rt_uint32_t tc_run_num = 0;
228
229 for (index = 0; index < tc_loop; index ++)
230 {
231 i = 0;
232 is_find = RT_FALSE;
233
234 tc_fail_num = 0;
235 tc_run_num = 0;
236 if (tc_fail_list)
237 {
238 rt_memset(tc_fail_list, 0, TC_FAIL_LIST_SIZE);
239 }
240
241 LOG_I("[==========] [ utest ] loop %d/%d", index + 1, tc_loop);
242 LOG_I("[==========] [ utest ] started");
243 while(i < tc_num)
244 {
245 if (utest_name)
246 {
247 int len = rt_strlen(utest_name);
248 if (utest_name[len - 1] == '*')
249 {
250 len -= 1;
251 if (rt_memcmp(tc_table[i].name, utest_name, len) != 0)
252 {
253 i++;
254 continue;
255 }
256 }
257 else if (rt_strcmp(tc_table[i].name, utest_name) != 0)
258 {
259 i++;
260 continue;
261 }
262 }
263 is_find = RT_TRUE;
264
265 LOG_I("[----------] [ testcase ] (%s) started", tc_table[i].name);
266 if (tc_table[i].init != RT_NULL)
267 {
268 if (tc_table[i].init() != RT_EOK)
269 {
270 LOG_E("[ FAILED ] [ result ] testcase init (%s)", tc_table[i].name);
271 goto __tc_continue;
272 }
273 }
274
275 if (tc_table[i].tc != RT_NULL)
276 {
277 tc_table[i].tc();
278 if (local_utest.failed_num == 0)

Callers 2

utest_thr_entryFunction · 0.85
utest_testcase_runFunction · 0.85

Calls 4

rt_memsetFunction · 0.85
rt_strlenFunction · 0.85
rt_memcmpFunction · 0.85
rt_strcmpFunction · 0.85

Tested by

no test coverage detected