int main (int argc, char *argv[]) { int i; int ret; #ifdef HAVE_GTK gtk_init(&argc, &argv); #if !GLIB_CHECK_VERSION(2,32,0) // backward compatibility with Debian 6 and CentOS 6 g_thread_init(NULL); #endif gdk_threads_init(); #endif liblinphone_tester_init(NULL); linphone_core_set_log_level(ORTP_ERROR); for(i = 1; i < argc; ++i) { if (strcmp(argv[i], "--verbose") == 0) { linphone_core_set_log_level(ORTP_MESSAGE); } else if (strcmp(argv[i], "--silent") == 0) { linphone_core_set_log_level(ORTP_FATAL); } else if (strcmp(argv[i],"--log-file")==0){ CHECK_ARG("--log-file", ++i, argc); if (liblinphone_tester_set_log_file(argv[i]) < 0) return -2; } else if (strcmp(argv[i],"--domain")==0){ CHECK_ARG("--domain", ++i, argc); test_domain=argv[i]; } else if (strcmp(argv[i],"--auth-domain")==0){ CHECK_ARG("--auth-domain", ++i, argc); auth_domain=argv[i]; }else if (strcmp(argv[i],"--dns-hosts")==0){ CHECK_ARG("--dns-hosts", ++i, argc); userhostsfile=argv[i]; } else if (strcmp(argv[i],"--keep-recorded-files")==0){ liblinphone_tester_keep_recorded_files(TRUE); } else if (strcmp(argv[i],"--disable-leak-detector")==0){ liblinphone_tester_disable_leak_detector(TRUE); } else if (strcmp(argv[i],"--disable-tls-support")==0){ liblinphone_tester_tls_support_disabled = TRUE; } else if (strcmp(argv[i],"--no-ipv6")==0){ liblinphonetester_ipv6 = FALSE; } else if (strcmp(argv[i],"--show-account-manager-logs")==0){ liblinphonetester_show_account_manager_logs=TRUE; } else { int bret = bc_tester_parse_args(argc, argv, i); if (bret>0) { i += bret - 1; continue; } else if (bret<0) { bc_tester_helper(argv[0], liblinphone_helper); } return bret; } } ret = bc_tester_start(argv[0]); liblinphone_tester_uninit(); return ret; }
static int collect_cleanup() { linphone_core_set_log_level(old_log_level); // liblinphone_log_collection_enabled = old_collection_state; // CU_ASSERT_FALSE("Fixme: // liblinphone_log_collection_enabled = old_collection_state;"); return 0; }
// static LinphoneLogCollectionState old_collection_state; static int collect_init() { old_log_level = ortp_get_log_level_mask(); // old_collection_state = liblinphone_log_collection_enabled; // CU_ASSERT_FALSE("Fixme: // old_collection_state = liblinphone_log_collection_enabled;"); // if we want some logs, we must force them... even if user dont want to! linphone_core_set_log_level(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); linphone_core_set_log_collection_path(liblinphone_tester_writable_dir_prefix); return 0; }