flow: Merged 'better-native-loader-error-messages' to ('develop').
--- a/CMakeLists.txt Thu Mar 03 22:15:04 2016 -0600
+++ b/CMakeLists.txt Tue Mar 15 22:08:58 2016 -0500
@@ -106,7 +106,7 @@
-pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32.0 gobject-2.0)
+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.34.0 gobject-2.0) # we separate gmodule out so our test aren't linked to it
pkg_check_modules(GMODULE REQUIRED gmodule-2.0)
--- a/ChangeLog Thu Mar 03 22:15:04 2016 -0600
+++ b/ChangeLog Tue Mar 15 22:08:58 2016 -0500
@@ -1,4 +1,6 @@
+ * Bumped the glib requirement to 2.34.0 + * Fix some error reporting with the native loader * Added a load-failed signal which is emitted when a plugin fails to load
--- a/gplugin/gplugin-native-loader.c Thu Mar 03 22:15:04 2016 -0600
+++ b/gplugin/gplugin-native-loader.c Tue Mar 15 22:08:58 2016 -0500
@@ -132,7 +132,7 @@
*error = g_error_new(GPLUGIN_DOMAIN, 0,
_("the query function did not return a "
"GPluginPluginInfo instance"));
@@ -151,7 +151,7 @@
if(!GPLUGIN_IS_PLUGIN_INFO(info)) {
*error = g_error_new(GPLUGIN_DOMAIN, 0,
_("the query function did not return a "
"GPluginPluginInfo instance"));
--- a/gplugin/tests/CMakeLists.txt Thu Mar 03 22:15:04 2016 -0600
+++ b/gplugin/tests/CMakeLists.txt Tue Mar 15 22:08:58 2016 -0500
@@ -31,6 +31,7 @@
add_subdirectory(load-on-query-fail)
add_subdirectory(versioned-dependencies)
add_subdirectory(bind-local)
+add_subdirectory(unresolved-symbol) ###############################################################################
@@ -116,6 +117,15 @@
add_dependencies(test-bind-local bind-local)
add_definitions(-DTEST_BIND_LOCAL_DIR="${CMAKE_CURRENT_BINARY_DIR}/bind-local/")
+####################################### +####################################### +add_gtest(test-unresolved-symbol) +add_dependencies(test-unresolved-symbol unresolved-symbol) + -DPLUGIN_DIR="${CMAKE_CURRENT_BINARY_DIR}/unresolved-symbol" ###############################################################################
###############################################################################
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/test-unresolved-symbol.c Tue Mar 15 22:08:58 2016 -0500
@@ -0,0 +1,60 @@
+ * Copyright (C) 2011-2016 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-native.h> +/****************************************************************************** + *****************************************************************************/ +test_unresolved_symbol(void) { + "*undefined symbol: some_unresolved_symbol" + gplugin_manager_remove_paths(); + gplugin_manager_append_path(PLUGIN_DIR); + gplugin_manager_refresh(); + g_test_assert_expected_messages(); +/****************************************************************************** + *****************************************************************************/ +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + /* test the load on query flag */ + g_test_add_func("/loaders/native/unresolved-symbol", + test_unresolved_symbol); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/unresolved-symbol/CMakeLists.txt Tue Mar 15 22:08:58 2016 -0500
@@ -0,0 +1,1 @@
+add_test_plugin(unresolved-symbol) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/unresolved-symbol/unresolved-symbol.c Tue Mar 15 22:08:58 2016 -0500
@@ -0,0 +1,41 @@
+ * Copyright (C) 2011-2016 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-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + some_unresolved_symbol(); +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error)