[gnome-builder] build: link tests against plugins .so



commit 96cce33aaa5188996be8a5628a542f1f7bb5ec89
Author: Christian Hergert <chergert redhat com>
Date:   Sun Sep 24 11:49:41 2017 -0700

    build: link tests against plugins .so
    
    We need access to the plugins contained in the .so for the tests to
    complete properly.

 src/main.c                          |    4 +---
 src/plugins/gnome-builder-plugins.h |   27 +++++++++++++++++++++++++++
 src/tests/meson.build               |    1 +
 src/tests/test-ide-buffer-manager.c |    2 ++
 src/tests/test-ide-buffer.c         |    2 ++
 src/tests/test-ide-build-pipeline.c |    2 ++
 src/tests/test-ide-context.c        |    3 +++
 src/tests/test-ide-file-settings.c  |    3 +++
 src/tests/test-ide-indenter.c       |    2 ++
 src/tests/test-snippet.c            |    2 ++
 src/tests/test-vim.c                |    3 +++
 11 files changed, 48 insertions(+), 3 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index a9a8f79..d95586a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,12 +22,10 @@
 #include <gtksourceview/gtksource.h>
 
 #include "application/ide-application-private.h"
+#include "plugins/gnome-builder-plugins.h"
 
 #include "bug-buddy.h"
 
-/* Keep in sync with gnome-builder-plugins.c */
-extern void gnome_builder_plugins_init (void);
-
 static IdeApplicationMode early_mode;
 
 static gboolean
diff --git a/src/plugins/gnome-builder-plugins.h b/src/plugins/gnome-builder-plugins.h
new file mode 100644
index 0000000..cd09281
--- /dev/null
+++ b/src/plugins/gnome-builder-plugins.h
@@ -0,0 +1,27 @@
+/* gnome-builder-plugins.h
+ *
+ * Copyright (C) 2017 Christian Hergert <chergert redhat com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void gnome_builder_plugins_init (void);
+
+G_END_DECLS
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 1bd42d0..2a5fe1d 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -16,6 +16,7 @@ ide_test_cflags = [
 ide_test_deps = [
   libide_dep,
   libpeas_dep,
+  gnome_builder_plugins_dep,
 ]
 
 ide_context = executable('test-ide-context',
diff --git a/src/tests/test-ide-buffer-manager.c b/src/tests/test-ide-buffer-manager.c
index 0c72096..f4c7e40 100644
--- a/src/tests/test-ide-buffer-manager.c
+++ b/src/tests/test-ide-buffer-manager.c
@@ -21,6 +21,7 @@
 #include <ide.h>
 
 #include "application/ide-application-tests.h"
+#include "../plugins/gnome-builder-plugins.h"
 
 static gint   save_count;
 static gint   load_count;
@@ -184,6 +185,7 @@ main (gint   argc,
 
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/BufferManager/basic", test_buffer_manager_basic, NULL, 
required_plugins);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/src/tests/test-ide-buffer.c b/src/tests/test-ide-buffer.c
index 856e2fd..ae85829 100644
--- a/src/tests/test-ide-buffer.c
+++ b/src/tests/test-ide-buffer.c
@@ -23,6 +23,7 @@
 #include <ide.h>
 
 #include "application/ide-application-tests.h"
+#include "../src/plugins/gnome-builder-plugins.h"
 
 static void
 test_buffer_basic_cb2 (GObject      *object,
@@ -115,6 +116,7 @@ main (gint   argc,
 
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/Buffer/basic", test_buffer_basic, NULL, required_plugins);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/src/tests/test-ide-build-pipeline.c b/src/tests/test-ide-build-pipeline.c
index 42b7953..a046fa4 100644
--- a/src/tests/test-ide-build-pipeline.c
+++ b/src/tests/test-ide-build-pipeline.c
@@ -21,6 +21,7 @@
 #include <ide.h>
 
 #include "application/ide-application-tests.h"
+#include "plugins/gnome-builder-plugins.h"
 
 static void
 execute_cb (GObject      *object,
@@ -116,6 +117,7 @@ main (gint   argc,
 
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/BuildPipeline/basic", test_build_pipeline, NULL);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/src/tests/test-ide-context.c b/src/tests/test-ide-context.c
index a61b883..6eb82f2 100644
--- a/src/tests/test-ide-context.c
+++ b/src/tests/test-ide-context.c
@@ -20,6 +20,8 @@
 
 #include "application/ide-application-tests.h"
 
+#include "../plugins/gnome-builder-plugins.h"
+
 static void
 test_new_async_cb1 (GObject      *object,
                     GAsyncResult *result,
@@ -82,6 +84,7 @@ main (gint   argc,
 
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/Context/new_async", test_new_async, NULL, required_plugins);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/src/tests/test-ide-file-settings.c b/src/tests/test-ide-file-settings.c
index 692abb8..34a51fd 100644
--- a/src/tests/test-ide-file-settings.c
+++ b/src/tests/test-ide-file-settings.c
@@ -21,6 +21,8 @@
 #include "application/ide-application-tests.h"
 #include "editorconfig/ide-editorconfig-file-settings.h"
 
+#include "../plugins/gnome-builder-plugins.h"
+
 static void
 test_filesettings (GCancellable        *cancellable,
                    GAsyncReadyCallback  callback,
@@ -176,6 +178,7 @@ main (gint argc,
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/FileSettings/basic", test_filesettings, NULL, required_plugins);
   ide_application_add_test (app, "/Ide/EditorconfigFileSettings/basic", test_editorconfig, NULL, 
required_plugins);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/src/tests/test-ide-indenter.c b/src/tests/test-ide-indenter.c
index b12746e..b1e7f81 100644
--- a/src/tests/test-ide-indenter.c
+++ b/src/tests/test-ide-indenter.c
@@ -21,6 +21,7 @@
 #include <string.h>
 
 #include "application/ide-application-tests.h"
+#include "../plugins/gnome-builder-plugins.h"
 
 typedef void (*IndentTestFunc) (IdeContext *context,
                                 GtkWidget  *widget);
@@ -181,6 +182,7 @@ main (gint argc,
 
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/CIndenter/basic", test_cindenter_basic, NULL, required_plugins);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/src/tests/test-snippet.c b/src/tests/test-snippet.c
index 1e499eb..f43717a 100644
--- a/src/tests/test-snippet.c
+++ b/src/tests/test-snippet.c
@@ -20,6 +20,7 @@
 #include <string.h>
 
 #include "application/ide-application-tests.h"
+#include "plugins/gnome-builder-plugins.h"
 #include "snippets/ide-source-snippet-private.h"
 #include "util/ide-gdk.h"
 
@@ -315,6 +316,7 @@ main (gint   argc,
 
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/Snippets/basic", test_snippets_basic, NULL);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 
diff --git a/src/tests/test-vim.c b/src/tests/test-vim.c
index 66e52ee..c316729 100644
--- a/src/tests/test-vim.c
+++ b/src/tests/test-vim.c
@@ -21,6 +21,8 @@
 
 #include "application/ide-application-tests.h"
 
+#include "../plugins/gnome-builder-plugins.h"
+
 typedef void (*VimTestFunc) (IdeContext *context,
                              GtkWidget  *widget);
 
@@ -190,6 +192,7 @@ main (gint   argc,
 
   app = ide_application_new ();
   ide_application_add_test (app, "/Ide/Vim/basic", test_vim_basic, NULL, required_plugins);
+  gnome_builder_plugins_init ();
   ret = g_application_run (G_APPLICATION (app), argc, argv);
   g_object_unref (app);
 


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