From 1cd616cf17eadf862246fbe239d33065f4c97216 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 5 Dec 2014 14:20:24 +0100 Subject: [PATCH] add --selfttest option to gtk app for very minimal app checking --- gtk/main.c | 12 ++++++++++++ tester/flexisip/flexisip.conf | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gtk/main.c b/gtk/main.c index 1a582ebd8..2bb9d5446 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -77,6 +77,7 @@ void linphone_gtk_status_icon_set_blinking(gboolean val); void _linphone_gtk_enable_video(gboolean val); void linphone_gtk_on_uribar_changed(GtkEditable *uribar, gpointer user_data); static void linphone_gtk_init_ui(void); +static void linphone_gtk_quit(void); #ifndef HAVE_GTK_OSX static gint main_window_x=0; @@ -90,6 +91,7 @@ static int start_option = START_LINPHONE; static gboolean no_video=FALSE; static gboolean iconified=FALSE; static gboolean run_audio_assistant=FALSE; +static gboolean selftest=FALSE; static gchar *workingdir=NULL; static char *progpath=NULL; gchar *linphone_logfile=NULL; @@ -162,6 +164,13 @@ static GOptionEntry linphone_options[]={ .arg_data = (gpointer) &run_audio_assistant, .description = N_("Run the audio assistant") }, + { + .long_name = "selftest", + .short_name = '\0', + .arg = G_OPTION_ARG_NONE, + .arg_data = (gpointer) &selftest, + .description = N_("Run self test and exit 0 if succeed") + }, {0} }; @@ -1319,6 +1328,9 @@ static void linphone_gtk_global_state_changed(LinphoneCore *lc, LinphoneGlobalSt break; case LinphoneGlobalOn: linphone_gtk_init_ui(); + if (selftest) { + gtk_timeout_add(300,(GtkFunction)gtk_main_quit,NULL); + } break; default: break; diff --git a/tester/flexisip/flexisip.conf b/tester/flexisip/flexisip.conf index 635ae0bda..96ac77cc4 100755 --- a/tester/flexisip/flexisip.conf +++ b/tester/flexisip/flexisip.conf @@ -18,7 +18,7 @@ auto-respawn=true # List of white space separated host names pointing to this machine. # This is to prevent loops while routing SIP messages. # Default value: localhost -aliases=localhost sipopen.example.org sip.example.org auth.example.org auth1.example.org auth2.example.org client.example.org +aliases=localhost sipopen.example.org sip.example.org auth.example.org auth1.example.org auth2.example.org client.example.org sip2.linphone.org # List of white space separated SIP uris where the proxy must listen.Wildcard # (*) can be used to mean 'all local ip addresses'. If 'transport'