int main(int argc, char **argv) { const char *poll_strategy = NULL; grpc_test_init(argc, argv); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_iomgr_init(&exec_ctx); grpc_iomgr_start(&exec_ctx); poll_strategy = grpc_get_poll_strategy_name(); if (poll_strategy != NULL && strcmp(poll_strategy, "epollsig") == 0) { test_add_fd_to_pollset(); test_threading(); } else { gpr_log(GPR_INFO, "Skipping the test. The test is only relevant for 'epollsig' " "strategy. and the current strategy is: '%s'", poll_strategy); } grpc_iomgr_shutdown(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx); return 0; }
int main(int argc, char **argv) { const char *poll_strategy = grpc_get_poll_strategy_name(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_test_init(argc, argv); grpc_init(); if (poll_strategy != NULL && (strcmp(poll_strategy, "epoll") == 0 || strcmp(poll_strategy, "epoll-threadpool") == 0)) { pollset_set_test_basic(); pollset_set_test_dup_fds(); pollset_set_test_empty_pollset(); } else { gpr_log(GPR_INFO, "Skipping the test. The test is only relevant for 'epoll' " "strategy. and the current strategy is: '%s'", poll_strategy); } grpc_exec_ctx_finish(&exec_ctx); grpc_shutdown(); return 0; }