tests: Use CALLS_PLUGIN_DIR to search for plugins in the build dir
There is no need to add a second variable to search for plugins, we can use CALLS_PLUGIN_DIR directly.
This commit is contained in:
@@ -9,12 +9,12 @@ test_env = [
|
||||
'MALLOC_CHECK_=2',
|
||||
'NO_AT_BRIDGE=1',
|
||||
'GSETTINGS_SCHEMA_DIR=@0@/data'.format(meson.project_build_root()),
|
||||
'CALLS_PLUGIN_DIR=@0@/plugins'.format(meson.project_build_root()),
|
||||
]
|
||||
|
||||
test_cflags = [
|
||||
'-DFOR_TESTING',
|
||||
'-Wno-error=deprecated-declarations',
|
||||
'-DPLUGIN_BUILDDIR="@0@"'.format(full_calls_plugin_builddir),
|
||||
]
|
||||
|
||||
test_link_args = [
|
||||
|
||||
@@ -262,12 +262,6 @@ main (gint argc,
|
||||
|
||||
gtk_test_init (&argc, &argv, NULL);
|
||||
|
||||
/* Add builddir as search path */
|
||||
#ifdef PLUGIN_BUILDDIR
|
||||
plugin_dir_provider = g_build_filename (PLUGIN_BUILDDIR, "provider", NULL);
|
||||
peas_engine_add_search_path (peas_engine_get_default (), plugin_dir_provider, NULL);
|
||||
#endif
|
||||
|
||||
g_test_add_func("/Calls/Manager/without_provider", test_calls_manager_without_provider);
|
||||
g_test_add_func("/Calls/Manager/dummy_provider", test_calls_manager_dummy_provider);
|
||||
g_test_add_func("/Calls/Manager/mm_provider", test_calls_manager_mm_provider);
|
||||
|
||||
@@ -48,7 +48,6 @@ gint
|
||||
main (gint argc,
|
||||
gchar *argv[])
|
||||
{
|
||||
g_autofree char *plugin_dir_provider = NULL;
|
||||
PeasEngine *peas;
|
||||
const gchar *dir;
|
||||
g_autofree char *default_plugin_dir_provider = NULL;
|
||||
@@ -57,11 +56,18 @@ main (gint argc,
|
||||
|
||||
peas = peas_engine_get_default ();
|
||||
|
||||
/* Add builddir as search path */
|
||||
#ifdef PLUGIN_BUILDDIR
|
||||
plugin_dir_provider = g_build_filename (PLUGIN_BUILDDIR, "provider", NULL);
|
||||
peas_engine_add_search_path (peas_engine_get_default (), plugin_dir_provider, NULL);
|
||||
#endif
|
||||
dir = g_getenv ("CALLS_PLUGIN_DIR");
|
||||
if (dir && dir[0] != '\0') {
|
||||
g_autofree char *plugin_dir_provider = NULL;
|
||||
plugin_dir_provider = g_build_filename (dir, "provider", NULL);
|
||||
g_debug ("Adding %s to plugin search path", plugin_dir_provider);
|
||||
peas_engine_prepend_search_path (peas, plugin_dir_provider, NULL);
|
||||
}
|
||||
|
||||
default_plugin_dir_provider = g_build_filename (PLUGIN_LIBDIR, "provider", NULL);
|
||||
g_debug ("Adding %s to plugin search path", default_plugin_dir_provider);
|
||||
peas_engine_add_search_path (peas, default_plugin_dir_provider, NULL);
|
||||
peas_engine_rescan_plugins (peas);
|
||||
|
||||
dir = g_getenv ("CALLS_PLUGIN_DIR");
|
||||
if (dir && dir[0] != '\0') {
|
||||
|
||||
Reference in New Issue
Block a user