MCPcopy Create free account
hub / github.com/F-Stack/f-stack / unit_test_suite_runner

Function unit_test_suite_runner

dpdk/app/test/test.c:320–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320int
321unit_test_suite_runner(struct unit_test_suite *suite)
322{
323 int test_success, i, ret;
324 const char *status;
325 struct unit_test_case tc;
326 struct unit_test_suite *ts;
327 unsigned int sub_ts_succeeded = 0, sub_ts_failed = 0;
328 unsigned int sub_ts_skipped = 0, sub_ts_total = 0;
329
330 unit_test_suite_reset_counts(suite);
331
332 if (suite->suite_name) {
333 printf(" + ------------------------------------------------------- +\n");
334 printf(" + Test Suite : %s\n", suite->suite_name);
335 }
336
337 if (suite->setup) {
338 test_success = suite->setup();
339 if (test_success != 0) {
340 /*
341 * setup did not pass, so count all enabled tests and
342 * mark them as failed/skipped
343 */
344 unit_test_suite_count_tcs_on_setup_fail(suite,
345 test_success, &sub_ts_failed,
346 &sub_ts_skipped, &sub_ts_total);
347 goto suite_summary;
348 }
349 }
350
351 printf(" + ------------------------------------------------------- +\n");
352
353 FOR_EACH_SUITE_TESTCASE(suite->total, suite, tc) {
354 if (!tc.enabled) {
355 suite->skipped++;
356 continue;
357 } else {
358 suite->executed++;
359 }
360
361 /* run test case setup */
362 if (tc.setup)
363 test_success = tc.setup();
364 else
365 test_success = TEST_SUCCESS;
366
367 if (test_success == TEST_SUCCESS) {
368 /* run the test case */
369 if (tc.testcase)
370 test_success = tc.testcase();
371 else if (tc.testcase_with_data)
372 test_success = tc.testcase_with_data(tc.data);
373 else
374 test_success = -ENOTSUP;
375
376 if (test_success == TEST_SUCCESS)
377 suite->succeeded++;

Callers 15

test_cryptodev_qat_asymFunction · 0.70
test_cryptodev_cn9k_asymFunction · 0.70
test_bitratestatsFunction · 0.70
test_pcapngFunction · 0.70
test_rib6Function · 0.70
test_slow_rib6Function · 0.70
test_event_dma_adapterFunction · 0.70
test_fbarrayFunction · 0.70
test_inline_ipsecFunction · 0.70

Calls 3

printfFunction · 0.50

Tested by

no test coverage detected