[gnome-logs/wip/test: 28/44] Add GlJournal mock API to logs UI



commit 3c6b0c877fae62a829b16b799c6741fb4dbd833e
Author: Rashi Aswani <aswanirashi19 gmail com>
Date:   Wed Jul 1 17:52:42 2015 +0530

    Add GlJournal mock API to logs UI

 Makefile.am                                    |   46 ++++++++++++++++++++++-
 tests/{gl-journal-mock.c => gl-mock-journal.c} |    6 ++--
 tests/{gl-journal-mock.h => gl-mock-journal.h} |    2 +
 tests/gnome-logs-test.c                        |   30 +++++++++++++++-
 4 files changed, 78 insertions(+), 6 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index cee871e..11bcece 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -145,7 +145,7 @@ tests_test_gl_util_SOURCES = \
        tests/test-gl-util.c \
        src/gl-util.c
 
-tests_test_gnome_logs_test_CPPFLAGS = \
+tests_gnome_logs_test_CPPFLAGS = \
         -DLOCALEDIR=\""$(localedir)"\" \
         -I$(top_builddir) \
         -I$(top_srcdir)/src \
@@ -159,7 +159,49 @@ tests_gnome_logs_test_LDADD = \
 
 tests_gnome_logs_test_SOURCES = \
         tests/gnome-logs-test.c \
-        tests/gl-journal-mock.c
+        tests/gl-mock-journal.c \
+       src/gl-application.c \
+        src/gl-categorylist.c \
+        src/gl-eventtoolbar.c \
+        src/gl-eventview.c \
+        src/gl-eventviewdetail.c \
+        src/gl-eventviewlist.c \
+        src/gl-eventviewrow.c \
+        src/gl-journal-model.c \
+        src/gl-util.c \
+        src/gl-window.c
+
+nodist_tests_gnome_logs_test_SOURCES = \
+        src/gl-enums.c \
+        src/gl-resource.c
+
+enum_data = \
+        src/gl-enums.c \
+        src/gl-enums.h
+
+tests_gnome_logs_test_enum_headers = \
+        $(srcdir)/src/gl-categorylist.h \
+        $(srcdir)/src/gl-eventtoolbar.h \
+        $(srcdir)/src/gl-eventview.h \
+        $(srcdir)/src/gl-eventviewrow.h \
+        $(srcdir)/src/gl-util.h
+
+noinst_tests_gnome_logs_test_headers = \
+        src/gl-application.h \
+        src/gl-categorylist.h \
+        src/gl-eventtoolbar.h \
+        src/gl-eventview.h \
+        src/gl-eventviewdetail.h \
+        src/gl-eventviewlist.h \
+        src/gl-eventviewrow.h \
+        src/gl-journal-model.h \
+        src/gl-util.h \
+        src/gl-window.h \
+       tests/gl-mock-journal.h
+
+nodist_tests_gnome_logs_test_headers = \
+        src/gl-enums.h \
+        src/gl-resource.h
 
 check_PROGRAMS = \
        tests/test-gl-util \
diff --git a/tests/gl-journal-mock.c b/tests/gl-mock-journal.c
similarity index 99%
rename from tests/gl-journal-mock.c
rename to tests/gl-mock-journal.c
index 77a87f5..7808acc 100644
--- a/tests/gl-journal-mock.c
+++ b/tests/gl-mock-journal.c
@@ -17,15 +17,15 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define gl_journal_ gl_mock_journal_
-
-#include "gl-journal-mock.h"
+#define gl_mock_journal gl_journal
+#include "gl-mock-journal.h"
 
 #include <glib-unix.h>
 #include <gio/gio.h>
 #include <stdlib.h>
 #include <string.h>
 
+
 struct _GlMockJournalEntry
 {
   GObject parent_instance;
diff --git a/tests/gl-journal-mock.h b/tests/gl-mock-journal.h
similarity index 98%
rename from tests/gl-journal-mock.h
rename to tests/gl-mock-journal.h
index 90ffc8b..cd961cd 100644
--- a/tests/gl-journal-mock.h
+++ b/tests/gl-mock-journal.h
@@ -17,10 +17,12 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #ifndef GL_MOCK_JOURNAL_H_
 #define GL_MOCK_JOURNAL_H_
 
 #include <gio/gio.h>
+#define gl_mock_journal gl_journal
 
 G_BEGIN_DECLS
 
diff --git a/tests/gnome-logs-test.c b/tests/gnome-logs-test.c
index afcc252..b4784a5 100644
--- a/tests/gnome-logs-test.c
+++ b/tests/gnome-logs-test.c
@@ -15,8 +15,23 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#include "config.h"
 
-#include "gl-journal-mock.h"
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include "../src/gl-application.h"
+#include "../src/gl-eventviewdetail.h"
+#include "../src/gl-journal-model.h"
+#include "../src/gl-categorylist.h"
+#include "../src/gl-eventview.h"
+#include "../src/gl-enums.h"
+#include "../src/gl-eventtoolbar.h"
+#include "../src/gl-eventviewlist.h"
+#include "../src/gl-eventviewrow.h"
+#include "../src/gl-util.h"
+#include "../src/gl-window.h"
+#include "gl-mock-journal.h"
 
 static void
 check_log_message (void)
@@ -35,5 +50,18 @@ main (int argc, char** argv)
 
     g_test_add_func ("/util/check_log_message", check_log_message);
 
+    GtkApplication *application;
+
+    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+    bind_textdomain_codeset (PACKAGE_TARNAME, "UTF-8");
+    textdomain (GETTEXT_PACKAGE);
+
+    g_set_prgname (PACKAGE_TARNAME);
+    application = gl_application_new ();
+    g_application_run (G_APPLICATION (application), argc, argv);
+    g_object_unref (application);
+
+ //   return status;
+
     return g_test_run ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]