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

Function utest_testcase_run

components/utilities/utest/utest.c:366–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364#endif /* RT_UTEST_USING_AUTO_RUN */
365
366int utest_testcase_run(int argc, char** argv)
367{
368 static char utest_name[UTEST_NAME_MAX_LEN];
369 rt_memset(utest_name, 0x0, sizeof(utest_name));
370
371 tc_loop = 1;
372
373 if (argc == 1)
374 {
375 utest_thread_create(RT_NULL);
376 }
377 else if (argc == 2 || argc == 3 || argc == 4)
378 {
379 if (rt_strcmp(argv[1], "-thread") == 0)
380 {
381 if (argc == 3 || argc == 4)
382 {
383 rt_strncpy(utest_name, argv[2], sizeof(utest_name) -1);
384 if (argc == 4)
385 {
386 tc_loop = atoi(argv[3]);
387 }
388 }
389 utest_thread_create(utest_name);
390 }
391 else if (rt_strcmp(argv[1], "-help") == 0)
392 {
393 utest_help();
394 }
395 else
396 {
397 rt_strncpy(utest_name, argv[1], sizeof(utest_name) -1);
398 if (argc == 3)
399 {
400 tc_loop = atoi(argv[2]);
401 }
402 utest_do_run(utest_name);
403 }
404 }
405 else
406 {
407 LOG_E("[ error ] at (%s:%d), in param error.", __func__, __LINE__);
408 utest_help();
409 }
410
411 return RT_EOK;
412}
413MSH_CMD_EXPORT_ALIAS(utest_testcase_run, utest_run, utest_run [-thread or -help] [testcase name] [loop num], optenable);
414
415utest_t utest_handle_get(void)

Callers

nothing calls this directly

Calls 6

rt_memsetFunction · 0.85
utest_thread_createFunction · 0.85
rt_strcmpFunction · 0.85
rt_strncpyFunction · 0.85
utest_helpFunction · 0.85
utest_do_runFunction · 0.85

Tested by

no test coverage detected