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

Function test_setup

dpdk/app/test/test_dispatcher.c:707–757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705struct test_app *test_app;
706
707static int
708test_setup(void)
709{
710 int rc;
711
712 if (rte_lcore_count() < MIN_LCORES) {
713 printf("Not enough cores for dispatcher_autotest; expecting at "
714 "least %d.\n", MIN_LCORES);
715 return TEST_SKIPPED;
716 }
717
718 test_app = test_app_create();
719 TEST_ASSERT(test_app != NULL, "Unable to allocate memory");
720
721 rc = test_app_setup_event_dev(test_app);
722 if (rc != TEST_SUCCESS)
723 goto err_free_app;
724
725 rc = test_app_create_dispatcher(test_app);
726 if (rc != TEST_SUCCESS)
727 goto err_teardown_event_dev;
728
729 rc = test_app_setup_service_cores(test_app);
730 if (rc != TEST_SUCCESS)
731 goto err_free_dispatcher;
732
733 rc = test_app_register_callbacks(test_app);
734 if (rc != TEST_SUCCESS)
735 goto err_teardown_service_cores;
736
737 rc = test_app_bind_ports(test_app);
738 if (rc != TEST_SUCCESS)
739 goto err_unregister_callbacks;
740
741 return TEST_SUCCESS;
742
743err_unregister_callbacks:
744 test_app_unregister_callbacks(test_app);
745err_teardown_service_cores:
746 test_app_teardown_service_cores(test_app);
747err_free_dispatcher:
748 test_app_free_dispatcher(test_app);
749err_teardown_event_dev:
750 test_app_teardown_event_dev(test_app);
751err_free_app:
752 test_app_free(test_app);
753
754 test_app = NULL;
755
756 return rc;
757}
758
759static void test_teardown(void)
760{

Callers

nothing calls this directly

Calls 13

rte_lcore_countFunction · 0.85
test_app_createFunction · 0.85
test_app_setup_event_devFunction · 0.85
test_app_bind_portsFunction · 0.85
test_app_free_dispatcherFunction · 0.85
test_app_freeFunction · 0.85

Tested by

no test coverage detected