[gnome-settings-daemon] print-notifications: Add test tool
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] print-notifications: Add test tool
- Date: Fri, 9 Mar 2012 11:14:29 +0000 (UTC)
commit fe6bc68947f072c7530bc0c518674a0c73881eb2
Author: Lars Uebernickel <lars uebernickel canonical com>
Date: Tue Dec 6 19:58:30 2011 +0100
print-notifications: Add test tool
https://bugzilla.gnome.org/show_bug.cgi?id=665689
plugins/print-notifications/Makefile.am | 26 +++++++++
.../print-notifications/test-print-notifications.c | 60 ++++++++++++++++++++
2 files changed, 86 insertions(+), 0 deletions(-)
---
diff --git a/plugins/print-notifications/Makefile.am b/plugins/print-notifications/Makefile.am
index 48494d9..35fe142 100644
--- a/plugins/print-notifications/Makefile.am
+++ b/plugins/print-notifications/Makefile.am
@@ -48,6 +48,32 @@ gsd_printer_LDADD = \
$(CUPS_LIBS) \
$(LIBNOTIFY_LIBS)
+noinst_PROGRAMS = \
+ test-print-notifications
+
+test_print_notifications_SOURCES = \
+ gsd-print-notifications-manager.c \
+ gsd-print-notifications-manager.h \
+ test-print-notifications.c
+
+test_print_notifications_CPPFLAGS = \
+ -I$(top_srcdir)/gnome-settings-daemon \
+ -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
+ -DLIBEXECDIR=\""$(libexecdir)"\" \
+ $(AM_CPPFLAGS)
+
+test_print_notifications_CFLAGS = \
+ $(PLUGIN_CFLAGS) \
+ $(SETTINGS_PLUGIN_CFLAGS) \
+ $(AM_CFLAGS)
+
+test_print_notifications_LDADD = \
+ $(top_builddir)/gnome-settings-daemon/libgsd-profile.la \
+ $(SETTINGS_DAEMON_LIBS) \
+ $(SETTINGS_PLUGIN_LIBS) \
+ $(CUPS_LIBS) \
+ $(LIBNOTIFY_LIBS)
+
EXTRA_DIST = \
$(plugin_in_files)
diff --git a/plugins/print-notifications/test-print-notifications.c b/plugins/print-notifications/test-print-notifications.c
new file mode 100644
index 0000000..098d7f1
--- /dev/null
+++ b/plugins/print-notifications/test-print-notifications.c
@@ -0,0 +1,60 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 William Jon McCann <mccann jhu edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ *
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include "gsd-print-notifications-manager.h"
+
+static GsdPrintNotificationsManager *manager = NULL;
+
+int
+main (int argc,
+ char **argv)
+{
+ GError *error;
+
+ bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
+ g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
+
+ error = NULL;
+ if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) {
+ fprintf (stderr, "%s", error->message);
+ g_error_free (error);
+ exit (1);
+ }
+
+ manager = gsd_print_notifications_manager_new ();
+
+ error = NULL;
+ gsd_print_notifications_manager_start (manager, &error);
+
+ gtk_main ();
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]