From 8072a97d30c0e3aaa9f02b89f53ae9af247e473b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 16:47:45 -0500 Subject: Adding a new sample approver --- tests/Makefile.am | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 8d356bc..a920a20 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ check_PROGRAMS = \ + test-approver \ test-libappindicator \ test-libappindicator-dbus-client \ test-libappindicator-dbus-server \ @@ -98,6 +99,21 @@ test_libappindicator_status_server_LDADD = \ $(INDICATOR_LIBS) \ $(top_builddir)/src/libappindicator.la +######################################### +## test-approver +######################################### + +test_approver_SOURCES = \ + test-approver.c + +test_approver_CFLAGS = \ + $(INDICATOR_CFLAGS) \ + -Wall -Werror \ + -I$(top_srcdir)/src + +test_approver_LDADD = \ + $(INDICATOR_LIBS) + ######################################### ## test-libappindicator-fallback ######################################### -- cgit v1.2.3 From d7c39d7b2654985016f533217e300b5dd5573020 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 21:10:00 -0500 Subject: Building an application indicator too! --- tests/Makefile.am | 3 ++- tests/test-approver.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index a920a20..6ee3a02 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -112,7 +112,8 @@ test_approver_CFLAGS = \ -I$(top_srcdir)/src test_approver_LDADD = \ - $(INDICATOR_LIBS) + $(INDICATOR_LIBS) \ + $(top_builddir)/src/libappindicator.la ######################################### ## test-libappindicator-fallback diff --git a/tests/test-approver.c b/tests/test-approver.c index fd90bf7..609036c 100644 --- a/tests/test-approver.c +++ b/tests/test-approver.c @@ -5,9 +5,14 @@ #include "notification-watcher-client.h" #include "dbus-shared.h" +#include "app-indicator.h" #define APPROVER_PATH "/my/approver" +#define INDICATOR_ID "test-indicator-id" +#define INDICATOR_ICON "test-indicator-icon-name" +#define INDICATOR_CATEGORY APP_INDICATOR_CATEGORY_APPLICATION_STATUS + #define TEST_APPROVER_TYPE (test_approver_get_type ()) #define TEST_APPROVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_APPROVER_TYPE, TestApprover)) #define TEST_APPROVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_APPROVER_TYPE, TestApproverClass)) @@ -37,6 +42,7 @@ static void _notification_approver_server_approve_item (void); GMainLoop * main_loop = NULL; DBusGConnection * session_bus = NULL; DBusGProxy * bus_proxy = NULL; +AppIndicator * app_indicator = NULL; gboolean passed = FALSE; G_DEFINE_TYPE (TestApprover, test_approver, G_TYPE_OBJECT); @@ -77,6 +83,13 @@ register_cb (DBusGProxy * proxy, GError * error, gpointer user_data) } g_debug("Building App Indicator"); + app_indicator = app_indicator_new(INDICATOR_ID, INDICATOR_ICON, INDICATOR_CATEGORY); + + GtkWidget * menu = gtk_menu_new(); + GtkWidget * mi = gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, NULL); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi); + + app_indicator_set_menu(app_indicator, GTK_MENU(menu)); return; } -- cgit v1.2.3 From 3c43fed297b0804d6f2fd60dbcab68c3ed492047 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 21:21:22 -0500 Subject: Building up to a formal test --- tests/Makefile.am | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 6ee3a02..35d557e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -115,6 +115,15 @@ test_approver_LDADD = \ $(INDICATOR_LIBS) \ $(top_builddir)/src/libappindicator.la +test-approver-tester: test-approver Makefile.am + @echo "#!/bin/bash" > $@ + @echo . $(srcdir)/run-xvfb.sh >> $@ + @echo $(DBUS_RUNNER) --task $(builddir)/test-approver --task-name Approver --task $(top_builddir)/src/indicator-application-service --task-name Service --ignore-return >> $@ + @chmod +x $@ + +TESTS += test-approver-tester + + ######################################### ## test-libappindicator-fallback ######################################### -- cgit v1.2.3 From 25b69bb08e3e5a3df7037f8ac786422ff53f6425 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Jul 2010 21:35:45 -0500 Subject: Need the built headers too --- tests/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 35d557e..867d4de 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -109,7 +109,8 @@ test_approver_SOURCES = \ test_approver_CFLAGS = \ $(INDICATOR_CFLAGS) \ -Wall -Werror \ - -I$(top_srcdir)/src + -I$(top_srcdir)/src \ + -I$(top_builddir)/src test_approver_LDADD = \ $(INDICATOR_LIBS) \ -- cgit v1.2.3 From 8a0649a9f1fe4914149a86f42f5e503be8edd87f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 12 Jul 2010 13:55:08 -0500 Subject: Adding in setting the environment variable to adjust the timeout to be twice as long for slow systems. --- tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 867d4de..f2bdbb2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -118,6 +118,7 @@ test_approver_LDADD = \ test-approver-tester: test-approver Makefile.am @echo "#!/bin/bash" > $@ + @echo export INDICATOR_SERVICE_SHUTDOWN_TIMEOUT=1000 >> $@ @echo . $(srcdir)/run-xvfb.sh >> $@ @echo $(DBUS_RUNNER) --task $(builddir)/test-approver --task-name Approver --task $(top_builddir)/src/indicator-application-service --task-name Service --ignore-return >> $@ @chmod +x $@ -- cgit v1.2.3