# HG changeset patch
# Node ID 2cd3d3590438
# Parent  56abba6da605
diff --git a/gplugin/tests/auto-load-fail/meson.build b/gplugin/tests/auto-load-fail/meson.build
--- a/gplugin/tests/auto-load-fail/meson.build
+++ b/gplugin/tests/auto-load-fail/meson.build
@@ -1,3 +1,5 @@
-shared_library('auto-load-fail', 'auto-load-fail.c',
+plugin = shared_library('auto-load-fail', 'auto-load-fail.c',
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
+
+all_native_test_plugins += {'auto-load-fail': plugin}
diff --git a/gplugin/tests/auto-load-pass/meson.build b/gplugin/tests/auto-load-pass/meson.build
--- a/gplugin/tests/auto-load-pass/meson.build
+++ b/gplugin/tests/auto-load-pass/meson.build
@@ -1,3 +1,5 @@
-shared_library('auto-load-pass', 'auto-load-pass.c',
+plugin = shared_library('auto-load-pass', 'auto-load-pass.c',
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
+
+all_native_test_plugins += {'auto-load-pass': plugin}
diff --git a/gplugin/tests/bad-plugins/meson.build b/gplugin/tests/bad-plugins/meson.build
--- a/gplugin/tests/bad-plugins/meson.build
+++ b/gplugin/tests/bad-plugins/meson.build
@@ -1,3 +1,5 @@
-shared_library('query-error', 'query-error.c',
+plugin = shared_library('query-error', 'query-error.c',
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
+
+all_native_test_plugins += {'bad-plugins': plugin}
diff --git a/gplugin/tests/bind-global/meson.build b/gplugin/tests/bind-global/meson.build
--- a/gplugin/tests/bind-global/meson.build
+++ b/gplugin/tests/bind-global/meson.build
@@ -1,3 +1,5 @@
-shared_library('bind-global', 'bind-global.c',
+plugin = shared_library('bind-global', 'bind-global.c',
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
+
+all_native_test_plugins += {'bind-global': plugin}
diff --git a/gplugin/tests/dynamic-type/meson.build b/gplugin/tests/dynamic-type/meson.build
--- a/gplugin/tests/dynamic-type/meson.build
+++ b/gplugin/tests/dynamic-type/meson.build
@@ -5,8 +5,10 @@ dynamic_type_provider = shared_library('
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
 
-shared_module('dynamic-type-user', 'dynamic-type-user.c',
+dynamic_type_user = shared_module('dynamic-type-user', 'dynamic-type-user.c',
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
 
+all_native_test_plugins += {'dynamic-type': [dynamic_type_provider, dynamic_type_user]}
+
 endif
diff --git a/gplugin/tests/id-collision/meson.build b/gplugin/tests/id-collision/meson.build
--- a/gplugin/tests/id-collision/meson.build
+++ b/gplugin/tests/id-collision/meson.build
@@ -1,7 +1,9 @@
-shared_library('id-collision1', 'id-collision1.c',
+plugin1 = shared_library('id-collision1', 'id-collision1.c',
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
 
-shared_library('id-collision2', 'id-collision2.c',
+plugin2 = shared_library('id-collision2', 'id-collision2.c',
 	name_prefix : '',
 	dependencies : [gplugin_dep, GLIB])
+
+all_native_test_plugins += {'id-collision': [plugin1, plugin2]}
diff --git a/gplugin/tests/meson.build b/gplugin/tests/meson.build
--- a/gplugin/tests/meson.build
+++ b/gplugin/tests/meson.build
@@ -1,3 +1,5 @@
+all_native_test_plugins = {}
+
 ###############################################################################
 # Subdirectories
 ###############################################################################
@@ -20,56 +22,31 @@ devenv.append('GPLUGIN_PLUGIN_PATH', mes
 #######################################
 current_build_dir = meson.current_build_dir()
 TESTS = {
-  # name -> c_args
-  'core': [
-    f'-DTEST_DIR="@current_build_dir@/plugins/"',
-    f'-DTEST_ID_DIR="@current_build_dir@/id-collision/"',
-  ],
-  'auto-load': [
-    f'-DTEST_DIR="@current_build_dir@/plugins/"',
-    f'-DTEST_AUTO_LOAD_PASS_DIR="@current_build_dir@/auto-load-pass"',
-    f'-DTEST_AUTO_LOAD_FAIL_DIR="@current_build_dir@/auto-load-fail"',
-  ],
-  'bind-global': [
-    f'-DTEST_BIND_GLOBAL_DIR="@current_build_dir@/bind-global/"',
-    f'-DTEST_BAD_DIR="@current_build_dir@/bad-plugins/"',
-    f'-DTEST_ID_DIR="@current_build_dir@/id-collision/"',
-  ],
-  'find-plugins': [
-    f'-DTEST_DIR="@current_build_dir@/plugins/"',
-  ],
-  'id-collision': [
-    f'-DTEST_ID_DIR="@current_build_dir@/id-collision/"',
-  ],
+  # name -> [required plugin names]
+  'core': ['plugins', 'id-collision'],
+  'auto-load': ['plugins', 'auto-load-pass', 'auto-load-fail'],
+  'bind-global': ['bad-plugins', 'bind-global', 'id-collision'],
+  'find-plugins': ['plugins'],
+  'id-collision': ['id-collision'],
   'id-normalize': [],
   'loader': [],
   'loader-registration': [],
-  'newest-version': [
-    f'-DTEST_DIR="@current_build_dir@/newest-version/"',
-  ],
+  'newest-version': ['newest-version'],
   'option-group': [],
   'plugin-manager-paths': [],
   'plugin-info': [],
-  'signals': [
-    f'-DTEST_DIR="@current_build_dir@/plugins/"',
-  ],
+  'signals': ['plugins'],
   'source': [],
-  'unresolved-symbol': [
-    f'-DPLUGIN_DIR="@current_build_dir@/unresolved-symbol/"',
-  ],
+  'unresolved-symbol': ['unresolved-symbol'],
   'version-compare': [],
-  'versioned-dependencies': [
-    f'-DTEST_VERSIONED_DEPENDENCY_DIR="@current_build_dir@/versioned-dependencies"',
-  ],
+  'versioned-dependencies': ['versioned-dependencies'],
 }
 
 # dynamic-type-provider and dynamic-type-user libs are not built on Windows
 # so no need to test them there either
 if host_machine.system() != 'windows'
 TESTS += {
-  'dynamic-type': [
-    f'-DTEST_DYNAMIC_DIR="@current_build_dir@/dynamic-type/"',
-  ],
+  'dynamic-type': ['dynamic-type'],
 }
 endif
 
@@ -77,25 +54,39 @@ endif
 # Tests
 ###############################################################################
 
-foreach prog, c_args : TESTS
+foreach prog, plugins : TESTS
+	c_args = []
+	depends = []
+	foreach name : plugins
+		macro_name = name.underscorify().to_upper()
+		c_args += f'-DTEST_@macro_name@_DIR="@current_build_dir@/@name@"'
+		depends += all_native_test_plugins[name]
+	endforeach
+
 	e = executable(f'test-@prog@', f'test-@prog@.c',
 	               c_args: c_args,
 	               dependencies: [gplugin_dep, GLIB, GOBJECT])
 	if prog == 'unresolved-symbol'
 		continue
 	endif
-	test(prog, e)
+	test(prog, e,
+	     depends: depends)
 endforeach
 
 #######################################
 # Native Loader
 #######################################
+c_args = []
+depends = []
+foreach name : ['plugins', 'bad-plugins', 'id-collision']
+	macro_name = name.underscorify().to_upper()
+	c_args += f'-DTEST_@macro_name@_DIR="@current_build_dir@/@name@"'
+	depends += all_native_test_plugins[name]
+endforeach
+
 e = executable('test-native-loader', 'test-native-loader.c',
-	c_args : [
-		f'-DTEST_DIR="@current_build_dir@/plugins/"',
-		f'-DTEST_BAD_DIR="@current_build_dir@/bad-plugins/"',
-		f'-DTEST_ID_DIR="@current_build_dir@/id-collision/"',
-	],
+	c_args : c_args,
 	link_with : gplugin_loader_tests,
 	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Native Loader', e)
+test('Native loader', e,
+     depends: depends)
diff --git a/gplugin/tests/newest-version/meson.build b/gplugin/tests/newest-version/meson.build
--- a/gplugin/tests/newest-version/meson.build
+++ b/gplugin/tests/newest-version/meson.build
@@ -8,8 +8,12 @@ MODULES = [
   'solo-no-version',
   'solo-non-semantic',
 ]
+plugins = []
 
 foreach module : MODULES
-	shared_module(module, f'@module@.c',
-	              name_prefix: '', dependencies : [gplugin_dep, GLIB])
+	plugins += shared_module(module, f'@module@.c',
+	                         name_prefix: '',
+	                         dependencies : [gplugin_dep, GLIB])
 endforeach
+
+all_native_test_plugins += {'newest-version': plugins}
diff --git a/gplugin/tests/plugins/meson.build b/gplugin/tests/plugins/meson.build
--- a/gplugin/tests/plugins/meson.build
+++ b/gplugin/tests/plugins/meson.build
@@ -7,10 +7,14 @@ LIBRARIES = [
   'unload-failed',
   'unload-shutdown',
 ]
+plugins = []
 
 foreach lib : LIBRARIES
-	shared_library(lib, f'@lib@.c',
-	               name_prefix: '', dependencies : [gplugin_dep, GLIB])
+	plugins += shared_library(lib, f'@lib@.c',
+	                          name_prefix: '',
+	                          dependencies : [gplugin_dep, GLIB])
 endforeach
 
+all_native_test_plugins += {'plugins': plugins}
+
 subdir('settings')
diff --git a/gplugin/tests/test-auto-load.c b/gplugin/tests/test-auto-load.c
--- a/gplugin/tests/test-auto-load.c
+++ b/gplugin/tests/test-auto-load.c
@@ -61,7 +61,7 @@ test_auto_load_fail(void)
 		 * 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_PLUGINS_DIR);
 		gplugin_manager_append_path(manager, TEST_AUTO_LOAD_FAIL_DIR);
 		gplugin_manager_refresh(manager);
 	}
diff --git a/gplugin/tests/test-core.c b/gplugin/tests/test-core.c
--- a/gplugin/tests/test-core.c
+++ b/gplugin/tests/test-core.c
@@ -92,7 +92,7 @@ test_gplugin_init_uninit_with_refresh_pl
 	gplugin_init(GPLUGIN_CORE_FLAGS_NONE);
 
 	manager = gplugin_manager_get_default();
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 	gplugin_manager_refresh(manager);
 
 	gplugin_uninit();
@@ -108,8 +108,8 @@ test_gplugin_init_uninit_with_double_ref
 
 	manager = gplugin_manager_get_default();
 
-	gplugin_manager_append_path(manager, TEST_DIR);
-	gplugin_manager_append_path(manager, TEST_ID_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
+	gplugin_manager_append_path(manager, TEST_ID_COLLISION_DIR);
 
 	/* run the first refresh and count everything */
 	gplugin_manager_refresh(manager);
diff --git a/gplugin/tests/test-dynamic-type.c b/gplugin/tests/test-dynamic-type.c
--- a/gplugin/tests/test-dynamic-type.c
+++ b/gplugin/tests/test-dynamic-type.c
@@ -35,7 +35,7 @@ test_dynamic_type(void)
 	GError *error = NULL;
 	gboolean ret = FALSE;
 
-	gplugin_manager_append_path(manager, TEST_DYNAMIC_DIR);
+	gplugin_manager_append_path(manager, TEST_DYNAMIC_TYPE_DIR);
 	gplugin_manager_refresh(manager);
 
 	provider =
diff --git a/gplugin/tests/test-find-plugins.c b/gplugin/tests/test-find-plugins.c
--- a/gplugin/tests/test-find-plugins.c
+++ b/gplugin/tests/test-find-plugins.c
@@ -89,7 +89,7 @@ test_gplugin_manager_find_plugins_with_s
 
 	manager = gplugin_manager_get_default();
 
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 	gplugin_manager_refresh(manager);
 
 	/* make sure that all the plugins are queried */
diff --git a/gplugin/tests/test-id-collision.c b/gplugin/tests/test-id-collision.c
--- a/gplugin/tests/test-id-collision.c
+++ b/gplugin/tests/test-id-collision.c
@@ -34,7 +34,7 @@ test_id_collision(void)
 
 	manager = gplugin_manager_get_default();
 
-	gplugin_manager_append_path(manager, TEST_ID_DIR);
+	gplugin_manager_append_path(manager, TEST_ID_COLLISION_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugins = gplugin_manager_find_plugins(manager, "gplugin/id-collision");
diff --git a/gplugin/tests/test-native-loader.c b/gplugin/tests/test-native-loader.c
--- a/gplugin/tests/test-native-loader.c
+++ b/gplugin/tests/test-native-loader.c
@@ -35,7 +35,7 @@ test_broken_depend_plugin_load(void)
 	GError *error = NULL;
 
 	/* add the test directory to the plugin manager's search paths */
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 
 	/* refresh the plugin manager */
 	gplugin_manager_refresh(manager);
@@ -66,7 +66,7 @@ test_query_error(void)
 		GPluginPlugin *plugin = NULL;
 
 		/* add the test directory to the plugin manager's search paths */
-		gplugin_manager_append_path(manager, TEST_BAD_DIR);
+		gplugin_manager_append_path(manager, TEST_BAD_PLUGINS_DIR);
 
 		/* refresh the plugin manager */
 		gplugin_manager_refresh(manager);
@@ -91,7 +91,7 @@ main(gint argc, gchar **argv)
 
 	gplugin_init(GPLUGIN_CORE_FLAGS_NONE);
 
-	gplugin_loader_tests_main(NULL, TEST_DIR, "native");
+	gplugin_loader_tests_main(NULL, TEST_PLUGINS_DIR, "native");
 
 	g_test_add_func(
 		"/loaders/native/load/broken_dependent",
diff --git a/gplugin/tests/test-newest-version.c b/gplugin/tests/test-newest-version.c
--- a/gplugin/tests/test-newest-version.c
+++ b/gplugin/tests/test-newest-version.c
@@ -29,7 +29,7 @@ test_newest_version(const gchar *id, con
 	GPluginPlugin *plugin = NULL;
 	GPluginPluginInfo *info = NULL;
 
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_NEWEST_VERSION_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugin = gplugin_manager_find_plugin_with_newest_version(manager, id);
diff --git a/gplugin/tests/test-signals.c b/gplugin/tests/test-signals.c
--- a/gplugin/tests/test-signals.c
+++ b/gplugin/tests/test-signals.c
@@ -175,7 +175,7 @@ test_gplugin_manager_signals_normal(void
 		G_CALLBACK(test_gplugin_manager_signals_normal_unloaded),
 		&data);
 
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugin =
@@ -231,7 +231,7 @@ test_gplugin_manager_signals_loading_sto
 		G_CALLBACK(test_gplugin_manager_signals_normal_unloaded),
 		&data);
 
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugin =
@@ -286,7 +286,7 @@ test_gplugin_manager_signals_unloading_s
 		G_CALLBACK(test_gplugin_manager_signals_normal_unloaded),
 		&data);
 
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugin =
@@ -332,7 +332,7 @@ test_gplugin_manager_signals_load_failur
 		G_CALLBACK(test_gplugin_manager_signals_load_failed),
 		&data);
 
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugin = gplugin_manager_find_plugin(manager, "gplugin/native-load-failed");
@@ -382,7 +382,7 @@ test_gplugin_manager_signals_unload_fail
 		G_CALLBACK(test_gplugin_manager_signals_unload_failed),
 		&data);
 
-	gplugin_manager_append_path(manager, TEST_DIR);
+	gplugin_manager_append_path(manager, TEST_PLUGINS_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugin =
diff --git a/gplugin/tests/test-unresolved-symbol.c b/gplugin/tests/test-unresolved-symbol.c
--- a/gplugin/tests/test-unresolved-symbol.c
+++ b/gplugin/tests/test-unresolved-symbol.c
@@ -37,7 +37,7 @@ test_unresolved_symbol(void)
 		"*some_unresolved_symbol*");
 
 	gplugin_manager_remove_paths(manager);
-	gplugin_manager_append_path(manager, PLUGIN_DIR);
+	gplugin_manager_append_path(manager, TEST_UNRESOLVED_SYMBOL_DIR);
 	gplugin_manager_refresh(manager);
 
 	g_test_assert_expected_messages();
diff --git a/gplugin/tests/test-versioned-dependencies.c b/gplugin/tests/test-versioned-dependencies.c
--- a/gplugin/tests/test-versioned-dependencies.c
+++ b/gplugin/tests/test-versioned-dependencies.c
@@ -52,7 +52,7 @@ test_load_with_dependencies(void)
 
 	manager = gplugin_manager_get_default();
 
-	gplugin_manager_append_path(manager, TEST_VERSIONED_DEPENDENCY_DIR);
+	gplugin_manager_append_path(manager, TEST_VERSIONED_DEPENDENCIES_DIR);
 	gplugin_manager_refresh(manager);
 
 	plugin = gplugin_manager_find_plugin(manager, "gplugin/super-dependent");
diff --git a/gplugin/tests/unresolved-symbol/meson.build b/gplugin/tests/unresolved-symbol/meson.build
--- a/gplugin/tests/unresolved-symbol/meson.build
+++ b/gplugin/tests/unresolved-symbol/meson.build
@@ -6,9 +6,12 @@ else
     link_args = []
 endif
 
-shared_module('unresolved-symbol', 'unresolved-symbol.c',
+plugin = shared_module('unresolved-symbol',
+	'unresolved-symbol.c',
 	name_prefix : '',
 	link_args : link_args,
 	dependencies : [gplugin_dep, GLIB])
 
+all_native_test_plugins += {'unresolved-symbol': plugin}
+
 endif
diff --git a/gplugin/tests/versioned-dependencies/meson.build b/gplugin/tests/versioned-dependencies/meson.build
--- a/gplugin/tests/versioned-dependencies/meson.build
+++ b/gplugin/tests/versioned-dependencies/meson.build
@@ -11,8 +11,12 @@ LIBRARIES = [
   'baz',
   'fez',
 ]
+plugins = []
 
 foreach lib : LIBRARIES
-	shared_library(lib, f'@lib@.c',
-	               name_prefix: '', dependencies : [gplugin_dep, GLIB])
+	plugins += shared_library(lib, f'@lib@.c',
+	                          name_prefix: '',
+	                          dependencies : [gplugin_dep, GLIB])
 endforeach
+
+all_native_test_plugins += {'versioned-dependencies': plugins}
diff --git a/lua/meson.build b/lua/meson.build
--- a/lua/meson.build
+++ b/lua/meson.build
@@ -56,7 +56,7 @@ if not LUA.found()
 endif
 
 # now add the library
-shared_library('gplugin-lua',
+gplugin_lua = shared_library('gplugin-lua',
 	GPLUGIN_LUA_SOURCES,
 	GPLUGIN_LUA_HEADERS,
 	name_prefix : '',
diff --git a/lua/tests/meson.build b/lua/tests/meson.build
--- a/lua/tests/meson.build
+++ b/lua/tests/meson.build
@@ -6,7 +6,8 @@ e = executable('test-lua-loader', 'test-
 	],
 	link_with : gplugin_loader_tests,
 	dependencies : [GLIB, GOBJECT, LUA, gplugin_dep])
-test('Lua Loader', e)
+test('Lua loader', e,
+     depends: gplugin_lua)
 
 # Add the test plugins path to our environment variable
 devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_source_dir() / 'plugins')
diff --git a/python3/tests/meson.build b/python3/tests/meson.build
--- a/python3/tests/meson.build
+++ b/python3/tests/meson.build
@@ -6,7 +6,8 @@ e = executable('test-python3-loader', 't
 	],
 	link_with : gplugin_loader_tests,
 	dependencies : [GLIB, GOBJECT, PYTHON3, PYGOBJECT, gplugin_dep])
-test('Python3 loader', e)
+test('Python3 loader', e,
+     depends: gplugin_python3)
 
 # we can't see the symbols in gplugin-python3 externally, so use the static
 # version for testing
diff --git a/vala/tests/genie-plugins/meson.build b/vala/tests/genie-plugins/meson.build
--- a/vala/tests/genie-plugins/meson.build
+++ b/vala/tests/genie-plugins/meson.build
@@ -6,10 +6,13 @@ LIBRARIES = [
   'unload-shutdown',
   'unload-failed',
 ]
+all_genie_test_plugins = []
 
 foreach lib : LIBRARIES
-	shared_library(f'genie-@lib@-plugin', f'@lib@.gs',
-	               name_prefix: '', dependencies : [gplugin_dep, gplugin_vapi])
+	plugin = shared_library(f'genie-@lib@-plugin', f'@lib@.gs',
+	                        name_prefix: '',
+	                        dependencies : [gplugin_dep, gplugin_vapi])
+	all_genie_test_plugins += plugin
 endforeach
 
 # Add the test plugins path to our environment variable
diff --git a/vala/tests/meson.build b/vala/tests/meson.build
--- a/vala/tests/meson.build
+++ b/vala/tests/meson.build
@@ -1,3 +1,6 @@
+subdir('genie-plugins')
+subdir('plugins')
+
 e = executable('test-vala-loading', 'test-vala-loading.c',
 	include_directories : include_directories('.'),
 	c_args : [
@@ -5,7 +8,8 @@ e = executable('test-vala-loading', 'tes
 	],
 	link_with : gplugin_loader_tests,
 	dependencies : [GLIB, GOBJECT, gplugin_dep])
-test('Vala loading', e)
+test('Vala loading', e,
+     depends: all_vala_test_plugins)
 
 e = executable('test-genie-loading', 'test-genie-loading.c',
 	include_directories : include_directories('.'),
@@ -14,7 +18,5 @@ e = executable('test-genie-loading', 'te
 	],
 	link_with : gplugin_loader_tests,
 	dependencies : [GLIB, GOBJECT, gplugin_dep])
-test('Genie loading', e)
-
-subdir('genie-plugins')
-subdir('plugins')
+test('Genie loading', e,
+     depends: all_genie_test_plugins)
diff --git a/vala/tests/plugins/meson.build b/vala/tests/plugins/meson.build
--- a/vala/tests/plugins/meson.build
+++ b/vala/tests/plugins/meson.build
@@ -6,10 +6,13 @@ LIBRARIES = [
   'unload-failed',
   'unload-shutdown',
 ]
+all_vala_test_plugins = []
 
 foreach lib : LIBRARIES
-	shared_library(f'vala-@lib@-plugin', f'@lib@.vala',
-	               name_prefix: '', dependencies: [gplugin_dep, gplugin_vapi])
+	plugin = shared_library(f'vala-@lib@-plugin', f'@lib@.vala',
+	                        name_prefix: '',
+	                        dependencies: [gplugin_dep, gplugin_vapi])
+	all_vala_test_plugins += plugin
 endforeach
 
 # Add the test plugins path to our environment variable
