gplugin/gplugin

Parents 7ccf3db483d1
Children 68f5d1214e41
Rename the strangely named load-on-query property to the much more obvious auto-load

Testing Done:
Ran the unit tests

Reviewed at https://reviews.imfreedom.org/r/1094/
--- a/gplugin/gplugin-file-source.c Mon Sep 26 23:39:46 2022 -0500
+++ b/gplugin/gplugin-file-source.c Tue Sep 27 00:10:22 2022 -0500
@@ -367,7 +367,7 @@
/* Check if the plugin is supposed to be loaded on query, and
* if so, load it.
*/
- if(gplugin_plugin_info_get_load_on_query(info)) {
+ if(gplugin_plugin_info_get_auto_load(info)) {
GError *error = NULL;
gboolean loaded;
--- a/gplugin/gplugin-plugin-info.c Mon Sep 26 23:39:46 2022 -0500
+++ b/gplugin/gplugin-plugin-info.c Tue Sep 27 00:10:22 2022 -0500
@@ -62,7 +62,7 @@
guint32 abi_version;
gboolean internal;
- gboolean load_on_query;
+ gboolean auto_load;
gboolean bind_global;
gboolean unloadable;
@@ -78,6 +78,7 @@
PROP_PRIORITY,
PROP_ABI_VERSION,
PROP_INTERNAL,
+ PROP_AUTO_LOAD,
PROP_LOQ,
PROP_BIND_GLOBAL,
PROP_NAME,
@@ -167,12 +168,12 @@
}
static void
-gplugin_plugin_info_set_load_on_query(GPluginPluginInfo *info, gboolean loq)
+gplugin_plugin_info_set_auto_load(GPluginPluginInfo *info, gboolean auto_load)
{
GPluginPluginInfoPrivate *priv =
gplugin_plugin_info_get_instance_private(info);
- priv->load_on_query = loq;
+ priv->auto_load = auto_load;
}
static void
@@ -373,10 +374,9 @@
case PROP_INTERNAL:
g_value_set_boolean(value, gplugin_plugin_info_get_internal(info));
break;
+ case PROP_AUTO_LOAD:
case PROP_LOQ:
- g_value_set_boolean(
- value,
- gplugin_plugin_info_get_load_on_query(info));
+ g_value_set_boolean(value, gplugin_plugin_info_get_auto_load(info));
break;
case PROP_BIND_GLOBAL:
g_value_set_boolean(
@@ -468,10 +468,13 @@
case PROP_INTERNAL:
gplugin_plugin_info_set_internal(info, g_value_get_boolean(value));
break;
+ case PROP_AUTO_LOAD:
+ gplugin_plugin_info_set_auto_load(info, g_value_get_boolean(value));
+ break;
case PROP_LOQ:
- gplugin_plugin_info_set_load_on_query(
- info,
- g_value_get_boolean(value));
+ if(g_value_get_boolean(value)) {
+ gplugin_plugin_info_set_auto_load(info, TRUE);
+ }
break;
case PROP_BIND_GLOBAL:
gplugin_plugin_info_set_bind_global(
@@ -679,6 +682,25 @@
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
/**
+ * GPluginPluginInfo:auto-load:
+ *
+ * Whether or not the plugin should be loaded when it's queried.
+ *
+ * This is used by the loaders and may be useful to your application as
+ * well.
+ *
+ * Defaults to %FALSE.
+ *
+ * Since: 0.39.0
+ */
+ properties[PROP_AUTO_LOAD] = g_param_spec_boolean(
+ "auto-load",
+ "auto-load",
+ "Whether or not the plugin should be loaded when queried",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+ /**
* GPluginPluginInfo:load-on-query:
*
* Whether or not the plugin should be loaded when it's queried.
@@ -687,6 +709,8 @@
* well.
*
* Defaults to %FALSE.
+ *
+ * Deprecated: 0.39.0: Use [property@GPlugin.PluginInfo:auto-load] instead.
*/
properties[PROP_LOQ] = g_param_spec_boolean(
"load-on-query",
@@ -1062,15 +1086,44 @@
}
/**
+ * gplugin_plugin_info_get_auto_load:
+ * @info: The plugin info instance.
+ *
+ * Returns whether or not this plugin should be loaded when queried. This is
+ * useful for internal plugins that are adding functionality and should always
+ * be turned on. The plugin loaders use this to make sure all plugins can
+ * always be loaded.
+ *
+ * Returns: %TRUE if the plugin should be loaded when queried, %FALSE
+ * otherwise.
+ *
+ * Since: 0.39.0
+ */
+gboolean
+gplugin_plugin_info_get_auto_load(GPluginPluginInfo *info)
+{
+ GPluginPluginInfoPrivate *priv = NULL;
+
+ g_return_val_if_fail(GPLUGIN_IS_PLUGIN_INFO(info), FALSE);
+
+ priv = gplugin_plugin_info_get_instance_private(info);
+
+ return priv->auto_load;
+}
+
+/**
* gplugin_plugin_info_get_load_on_query:
* @info: The plugin info instance.
*
* Returns whether or not this plugin should be loaded when queried. This is
* useful for internal plugins that are adding functionality and should always
- * be turned on. The plugin loaders use this to make sure all plugins can
+ * be turned on. The plugin loaders use this to make sure all plugins can
* always be loaded.
*
- * Returns: %TRUE if the plugin should be loaded on query, %FALSE otherwise.
+ * Returns: %TRUE if the plugin should be loaded when queried, %FALSE
+ * otherwise.
+ *
+ * Deprecated: 0.39.0: Use [method@GPlugin.PluginInfo.get_auto_load] instead.
*/
gboolean
gplugin_plugin_info_get_load_on_query(GPluginPluginInfo *info)
@@ -1081,7 +1134,7 @@
priv = gplugin_plugin_info_get_instance_private(info);
- return priv->load_on_query;
+ return priv->auto_load;
}
/**
--- a/gplugin/gplugin-plugin-info.h Mon Sep 26 23:39:46 2022 -0500
+++ b/gplugin/gplugin-plugin-info.h Tue Sep 27 00:10:22 2022 -0500
@@ -60,7 +60,11 @@
gint gplugin_plugin_info_get_priority(GPluginPluginInfo *info);
guint32 gplugin_plugin_info_get_abi_version(GPluginPluginInfo *info);
gboolean gplugin_plugin_info_get_internal(GPluginPluginInfo *info);
+gboolean gplugin_plugin_info_get_auto_load(GPluginPluginInfo *info);
+
+G_DEPRECATED_FOR(gplugin_plugin_info_get_auto_load)
gboolean gplugin_plugin_info_get_load_on_query(GPluginPluginInfo *info);
+
const gchar *gplugin_plugin_info_get_name(GPluginPluginInfo *info);
const gchar *gplugin_plugin_info_get_version(GPluginPluginInfo *info);
const gchar *gplugin_plugin_info_get_settings_schema(GPluginPluginInfo *info);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/auto-load-fail/auto-load-fail.c Tue Sep 27 00:10:22 2022 -0500
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011-2021 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 <https://www.gnu.org/licenses/>.
+ */
+
+#include <gplugin.h>
+#include <gplugin-native.h>
+
+static GPluginPluginInfo *
+auto_load_fail_query(G_GNUC_UNUSED GError **error)
+{
+ /* clang-format off */
+ return gplugin_plugin_info_new(
+ "gplugin/auto-load-fail",
+ GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
+ "auto-load", TRUE,
+ NULL);
+ /* clang-format on */
+}
+
+static gboolean
+auto_load_fail_load(G_GNUC_UNUSED GPluginPlugin *plugin, GError **error)
+{
+ static int count = 1;
+
+ g_set_error(error, GPLUGIN_DOMAIN, 0, "called %d times", count++);
+
+ return FALSE;
+}
+
+static gboolean
+auto_load_fail_unload(
+ G_GNUC_UNUSED GPluginPlugin *plugin,
+ G_GNUC_UNUSED gboolean shutdown,
+ G_GNUC_UNUSED GError **error)
+{
+ return TRUE;
+}
+
+GPLUGIN_NATIVE_PLUGIN_DECLARE(auto_load_fail)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/auto-load-fail/meson.build Tue Sep 27 00:10:22 2022 -0500
@@ -0,0 +1,3 @@
+shared_library('auto-load-fail', 'auto-load-fail.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/auto-load-pass/auto-load-pass.c Tue Sep 27 00:10:22 2022 -0500
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011-2021 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 <https://www.gnu.org/licenses/>.
+ */
+
+#include <gplugin.h>
+#include <gplugin-native.h>
+
+static GPluginPluginInfo *
+auto_load_pass_query(G_GNUC_UNUSED GError **error)
+{
+ /* clang-format off */
+ return gplugin_plugin_info_new(
+ "gplugin/auto-load-pass",
+ GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
+ "auto-load", TRUE,
+ NULL);
+ /* clang-format on */
+}
+
+static gboolean
+auto_load_pass_load(
+ G_GNUC_UNUSED GPluginPlugin *plugin,
+ G_GNUC_UNUSED GError **error)
+{
+ return TRUE;
+}
+
+static gboolean
+auto_load_pass_unload(
+ G_GNUC_UNUSED GPluginPlugin *plugin,
+ G_GNUC_UNUSED gboolean shutdown,
+ G_GNUC_UNUSED GError **error)
+{
+ return TRUE;
+}
+
+GPLUGIN_NATIVE_PLUGIN_DECLARE(auto_load_pass)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/auto-load-pass/meson.build Tue Sep 27 00:10:22 2022 -0500
@@ -0,0 +1,3 @@
+shared_library('auto-load-pass', 'auto-load-pass.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- a/gplugin/tests/load-on-query-fail/load-on-query-fail.c Mon Sep 26 23:39:46 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2011-2021 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 <https://www.gnu.org/licenses/>.
- */
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-static GPluginPluginInfo *
-loq_fail_query(G_GNUC_UNUSED GError **error)
-{
- /* clang-format off */
- return gplugin_plugin_info_new(
- "gplugin/load-on-query-fail",
- GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
- "load-on-query", TRUE,
- NULL);
- /* clang-format on */
-}
-
-static gboolean
-loq_fail_load(G_GNUC_UNUSED GPluginPlugin *plugin, GError **error)
-{
- static int count = 1;
-
- g_set_error(error, GPLUGIN_DOMAIN, 0, "called %d times", count++);
-
- return FALSE;
-}
-
-static gboolean
-loq_fail_unload(
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED gboolean shutdown,
- G_GNUC_UNUSED GError **error)
-{
- return TRUE;
-}
-
-GPLUGIN_NATIVE_PLUGIN_DECLARE(loq_fail)
--- a/gplugin/tests/load-on-query-fail/meson.build Mon Sep 26 23:39:46 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-shared_library('load-on-query-fail', 'load-on-query-fail.c',
- name_prefix : '',
- dependencies : [gplugin_dep, GLIB])
--- a/gplugin/tests/load-on-query-pass/load-on-query-pass.c Mon Sep 26 23:39:46 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2011-2021 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 <https://www.gnu.org/licenses/>.
- */
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-static GPluginPluginInfo *
-loq_pass_query(G_GNUC_UNUSED GError **error)
-{
- /* clang-format off */
- return gplugin_plugin_info_new(
- "gplugin/load-on-query",
- GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
- "load-on-query", TRUE,
- NULL);
- /* clang-format on */
-}
-
-static gboolean
-loq_pass_load(G_GNUC_UNUSED GPluginPlugin *plugin, G_GNUC_UNUSED GError **error)
-{
- return TRUE;
-}
-
-static gboolean
-loq_pass_unload(
- G_GNUC_UNUSED GPluginPlugin *plugin,
- G_GNUC_UNUSED gboolean shutdown,
- G_GNUC_UNUSED GError **error)
-{
- return TRUE;
-}
-
-GPLUGIN_NATIVE_PLUGIN_DECLARE(loq_pass)
--- a/gplugin/tests/load-on-query-pass/meson.build Mon Sep 26 23:39:46 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-shared_library('load-on-query-pass', 'load-on-query-pass.c',
- name_prefix : '',
- dependencies : [gplugin_dep, GLIB])
--- a/gplugin/tests/meson.build Mon Sep 26 23:39:46 2022 -0500
+++ b/gplugin/tests/meson.build Tue Sep 27 00:10:22 2022 -0500
@@ -5,8 +5,8 @@
subdir('bind-global')
subdir('dynamic-type')
subdir('id-collision')
-subdir('load-on-query-fail')
-subdir('load-on-query-pass')
+subdir('auto-load-fail')
+subdir('auto-load-pass')
subdir('newest-version')
subdir('plugins')
subdir('unresolved-symbol')
@@ -106,19 +106,19 @@
test('ID Collision', e)
#######################################
-# Load On Query
+# Auto Load
#######################################
-e = executable('test-load-on-query', 'test-load-on-query.c',
+e = executable('test-auto-load', 'test-auto-load.c',
c_args : [
'-DTEST_DIR="@0@/plugins/"'.format(
meson.current_build_dir()),
- '-DTEST_LOAD_ON_QUERY_PASS_DIR="@0@/load-on-query-pass"'.format(
+ '-DTEST_AUTO_LOAD_PASS_DIR="@0@/auto-load-pass"'.format(
meson.current_build_dir()),
- '-DTEST_LOAD_ON_QUERY_FAIL_DIR="@0@/load-on-query-fail"'.format(
+ '-DTEST_AUTO_LOAD_FAIL_DIR="@0@/auto-load-fail"'.format(
meson.current_build_dir())
],
dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Load On Query', e)
+test('Auto Load', e)
#######################################
# Versioned Dependencies
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/test-auto-load.c Tue Sep 27 00:10:22 2022 -0500
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2011-2014 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 <https://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <gplugin.h>
+#include <gplugin-native.h>
+
+/******************************************************************************
+ * Tests
+ *****************************************************************************/
+static void
+test_auto_load_pass(void)
+{
+ GPluginManager *manager = gplugin_manager_get_default();
+ GPluginPlugin *plugin = NULL;
+
+ gplugin_manager_remove_paths(manager);
+ gplugin_manager_append_path(manager, TEST_AUTO_LOAD_PASS_DIR);
+ gplugin_manager_refresh(manager);
+
+ plugin = gplugin_manager_find_plugin(manager, "gplugin/auto-load-pass");
+ g_assert_nonnull(plugin);
+ g_assert_true(GPLUGIN_IS_PLUGIN(plugin));
+
+ g_assert_cmpint(
+ gplugin_plugin_get_state(plugin),
+ ==,
+ GPLUGIN_PLUGIN_STATE_LOADED);
+}
+
+static void
+test_auto_load_fail(void)
+{
+ if(g_test_subprocess()) {
+ GPluginManager *manager = gplugin_manager_get_default();
+
+ /* this test is very simple since we can't get the exact error
+ * condition that we want.
+ *
+ * There's an error condition where a plugin will be stored twice, but
+ * we can't test for it since a g_warning gets output that kills our
+ * fork, so we lose the internal state of the plugin manager and thus
+ * can't see the plugin stored twice. This has been fixed in the code,
+ * but it has to be looked for manually.
+ */
+ gplugin_manager_remove_paths(manager);
+ gplugin_manager_append_path(manager, TEST_DIR);
+ gplugin_manager_append_path(manager, TEST_AUTO_LOAD_FAIL_DIR);
+ gplugin_manager_refresh(manager);
+ }
+
+ g_test_trap_subprocess(NULL, 0, 0);
+
+ g_test_trap_assert_stderr("*failed to load*during query*");
+}
+
+static void
+test_loq(void)
+{
+ GPluginPluginInfo *info = NULL;
+
+ /* Make sure the load on query option is still honored and sets the
+ * auto-load property.
+ */
+ info = gplugin_plugin_info_new(
+ "test-loq",
+ 0x01020304,
+ "load-on-query",
+ TRUE,
+ NULL);
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+ g_assert_true(gplugin_plugin_info_get_load_on_query(info));
+ G_GNUC_END_IGNORE_DEPRECATIONS
+
+ g_assert_true(gplugin_plugin_info_get_auto_load(info));
+
+ g_clear_object(&info);
+}
+
+/******************************************************************************
+ * Main
+ *****************************************************************************/
+gint
+main(gint argc, gchar **argv)
+{
+ g_test_init(&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
+
+ gplugin_init(GPLUGIN_CORE_FLAGS_NONE);
+
+ /* test the load on query flag */
+ g_test_add_func("/loaders/native/auto-load/pass", test_auto_load_pass);
+ g_test_add_func("/loaders/native/auto-load/fail", test_auto_load_fail);
+ g_test_add_func("/loaders/native/loq", test_loq);
+
+ return g_test_run();
+}
--- a/gplugin/tests/test-load-on-query.c Mon Sep 26 23:39:46 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2011-2014 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 <https://www.gnu.org/licenses/>.
- */
-
-#include <stdlib.h>
-
-#include <glib.h>
-
-#include <gplugin.h>
-#include <gplugin-native.h>
-
-/******************************************************************************
- * Tests
- *****************************************************************************/
-/* load on query */
-static void
-test_load_on_query(void)
-{
- GPluginManager *manager = gplugin_manager_get_default();
- GPluginPlugin *plugin = NULL;
-
- gplugin_manager_remove_paths(manager);
- gplugin_manager_append_path(manager, TEST_LOAD_ON_QUERY_PASS_DIR);
- gplugin_manager_refresh(manager);
-
- plugin = gplugin_manager_find_plugin(manager, "gplugin/load-on-query");
- g_assert_nonnull(plugin);
- g_assert_true(GPLUGIN_IS_PLUGIN(plugin));
-
- g_assert_cmpint(
- gplugin_plugin_get_state(plugin),
- ==,
- GPLUGIN_PLUGIN_STATE_LOADED);
-}
-
-static void
-test_load_on_query_fail_subprocess(void)
-{
- GPluginManager *manager = gplugin_manager_get_default();
-
- /* this test is very simple since we can't get the exact error condition
- * that we want.
- *
- * There's an error condition where a plugin will be stored twice, but we
- * can't test for it since a g_warning gets output that kills our fork, so
- * we lose the internal state of the plugin manager and thus can't see the
- * plugin stored twice. This has been fixed in the code, but it has to be
- * looked for manually.
- */
- gplugin_manager_remove_paths(manager);
- gplugin_manager_append_path(manager, TEST_DIR);
- gplugin_manager_append_path(manager, TEST_LOAD_ON_QUERY_FAIL_DIR);
- gplugin_manager_refresh(manager);
-}
-
-static void
-test_load_on_query_fail(void)
-{
- g_test_trap_subprocess(
- "/loaders/native/load-on-query/fail/subprocess",
- 0,
- 0);
-
- g_test_trap_assert_stderr("*failed to load*during query*");
-}
-
-/******************************************************************************
- * Main
- *****************************************************************************/
-gint
-main(gint argc, gchar **argv)
-{
-
- g_test_init(&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
-
- gplugin_init(GPLUGIN_CORE_FLAGS_NONE);
-
- /* test the load on query flag */
- g_test_add_func("/loaders/native/load-on-query/pass", test_load_on_query);
- g_test_add_func(
- "/loaders/native/load-on-query/fail",
- test_load_on_query_fail);
- g_test_add_func(
- "/loaders/native/load-on-query/fail/subprocess",
- test_load_on_query_fail_subprocess);
-
- return g_test_run();
-}
--- a/gplugin/tests/test-plugin-info.c Mon Sep 26 23:39:46 2022 -0500
+++ b/gplugin/tests/test-plugin-info.c Tue Sep 27 00:10:22 2022 -0500
@@ -106,7 +106,7 @@
gchar **provides = NULL, **authors = NULL, **dependencies = NULL;
gint priority = 0;
guint abi_version = 0;
- gboolean internal = FALSE, load_on_query = FALSE;
+ gboolean internal = FALSE, auto_load = FALSE;
const gchar *const r_provides[] = {"foo", NULL};
const gchar *const r_authors[] = {"author", NULL};
const gchar *const r_dependencies[] = {"dependency", NULL};
@@ -119,7 +119,7 @@
"priority", 1000,
"abi_version", GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"internal", TRUE,
- "load-on-query", TRUE,
+ "auto-load", TRUE,
"name", "name",
"version", "version",
"license-id", "license-id",
@@ -145,7 +145,7 @@
"priority", &priority,
"abi_version", &abi_version,
"internal", &internal,
- "load-on-query", &load_on_query,
+ "auto-load", &auto_load,
"name", &name,
"version", &version,
"license-id", &license_id,
@@ -170,7 +170,7 @@
test_int(priority, 1000);
test_uint(abi_version, GPLUGIN_NATIVE_PLUGIN_ABI_VERSION);
test_true(internal);
- test_true(load_on_query);
+ test_true(auto_load);
test_string(name, "name");
test_string(version, "version");
test_string(license_id, "license-id");
@@ -230,7 +230,7 @@
gchar *website = NULL;
gchar **authors = NULL, **dependencies = NULL;
guint abi_version = 0;
- gboolean internal = FALSE, load_on_query = FALSE;
+ gboolean internal = FALSE, auto_load = FALSE;
const gchar *const r_authors[] = {"author", NULL};
const gchar *const r_dependencies[] = {"dependency", NULL};
@@ -239,7 +239,7 @@
"gplugin-test/plugin-info-test",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"internal", TRUE,
- "load-on-query", TRUE,
+ "auto-load", TRUE,
"name", "name",
"version", "version",
"license-id", "license-id",
@@ -263,7 +263,7 @@
"id", &id,
"abi_version", &abi_version,
"internal", &internal,
- "load-on-query", &load_on_query,
+ "auto-load", &auto_load,
"name", &name,
"version", &version,
"license-id", &license_id,
@@ -282,7 +282,7 @@
test_string(id, "gplugin-test/plugin-info-test");
test_uint(abi_version, GPLUGIN_NATIVE_PLUGIN_ABI_VERSION);
test_true(internal);
- test_true(load_on_query);
+ test_true(auto_load);
test_string(name, "name");
test_string(version, "version");
test_string(license_id, "license-id");
--- a/lua/gplugin-lua-core.c Mon Sep 26 23:39:46 2022 -0500
+++ b/lua/gplugin-lua-core.c Tue Sep 27 00:10:22 2022 -0500
@@ -40,7 +40,7 @@
"gplugin/lua-loader",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"internal", TRUE,
- "load-on-query", TRUE,
+ "auto-load", TRUE,
"name", "Lua Plugin Loader",
"version", GPLUGIN_VERSION,
"license-id", "LGPL-2.0-or-later",
--- a/python3/gplugin-python3-core.c Mon Sep 26 23:39:46 2022 -0500
+++ b/python3/gplugin-python3-core.c Tue Sep 27 00:10:22 2022 -0500
@@ -40,7 +40,7 @@
"gplugin/python3-loader",
GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
"internal", TRUE,
- "load-on-query", TRUE,
+ "auto-load", TRUE,
"name", "Python3 Plugin Loader",
"version", GPLUGIN_VERSION,
"license-id", "LGPL-2.0-or-later",