Get the test harness to pass for vala plugins
--- a/gplugin/meson.build Wed Jul 17 08:49:43 2019 -0500
+++ b/gplugin/meson.build Wed Jul 17 10:38:15 2019 -0500
@@ -245,6 +245,7 @@
GPLUGIN_PUBLIC_BUILT_SOURCES +
GPLUGIN_PUBLIC_BUILT_HEADERS,
includes : ['GModule-2.0', 'GObject-2.0'],
symbol_prefix : 'gplugin',
nsversion : '@0@.0'.format(GPLUGIN_MAJOR_VERSION),
--- a/vala/meson.build Wed Jul 17 08:49:43 2019 -0500
+++ b/vala/meson.build Wed Jul 17 10:38:15 2019 -0500
@@ -3,19 +3,12 @@
error('Vala generation requires GObject Introspection.')
- vapigen = find_program('vapigen')
- '--library', 'gplugin',
- '--directory', meson.current_build_dir(),
- output : 'gplugin.vapi',
+ gplugin_vapi = gnome.generate_vapi('gplugin', + sources : gplugin_gir[0], - install_dir : join_paths(get_option('datadir'), 'vala', 'vapi'),
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/meson.build Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,14 @@
+e = executable('test-vala-loading', 'test-vala-loading.c', + include_directories : include_directories('.'), + '-DVALA_PLUGIN_DIR="@0@/plugins"'.format(meson.current_build_dir()), + link_with : gplugin_loader_tests, + dependencies : [GLIB, GOBJECT, gplugin_dep]) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/basic.vala Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,48 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +public class BasicPluginInfo : GPlugin.PluginInfo { + public BasicPluginInfo() { + string[] authors = {"author1"}; + id: "gplugin/vala-basic-plugin", + abi_version: 0x01020304, + description: "description" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new BasicPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/dependent.vala Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,40 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +public class DependentPluginInfo : GPlugin.PluginInfo { + public DependentPluginInfo() { + string[] dependencies = {"dependency1", "dependency2"}; + id: "gplugin/vala-dependent-plugin", + dependencies: dependencies +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new DependentPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/load-exception.vala Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,39 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +public class LoadExceptionPluginInfo : GPlugin.PluginInfo { + public LoadExceptionPluginInfo() { + id: "gplugin/vala-load-exception" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new LoadExceptionPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { + error = new Error(Quark.from_string("gplugin"), 0, "explode"); +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/load-failed.vala Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,37 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +public class LoadFailedPluginInfo : GPlugin.PluginInfo { + public LoadFailedPluginInfo() { + id: "gplugin/vala-load-failed" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new LoadFailedPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/meson.build Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,17 @@
+ shared_library('vala-basic-plugin', 'basic.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-dependent-plugin', 'dependent.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-load-exception', 'load-exception.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-load-failed', 'load-failed.vala', + dependencies : [gplugin_dep, gplugin_vapi]) + shared_library('vala-unload-failed', 'unload-failed.vala', + dependencies : [gplugin_dep, gplugin_vapi]) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/plugins/unload-failed.vala Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,37 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +public class UnloadFailedPluginInfo : GPlugin.PluginInfo { + public UnloadFailedPluginInfo() { + id: "gplugin/vala-unload-failed" +public GPlugin.PluginInfo gplugin_query(out Error error) { + return new UnloadFailedPluginInfo(); +public bool gplugin_load(GPlugin.Plugin plugin, out Error error) { +public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) { --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vala/tests/test-vala-loading.c Wed Jul 17 10:38:15 2019 -0500
@@ -0,0 +1,34 @@
+ * Copyright (C) 2011-2019 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#include <gplugin/gplugin-loader-tests.h> +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplugin_loader_tests_main(NULL, VALA_PLUGIN_DIR, "vala");