# HG changeset patch
# Node ID 514d7a9d7625
# Parent  9541538492d0
diff --git a/gplugin-gtk4/meson.build b/gplugin-gtk4/meson.build
--- a/gplugin-gtk4/meson.build
+++ b/gplugin-gtk4/meson.build
@@ -41,15 +41,13 @@ GPLUGIN_GTK4_GENERATED_TARGETS = [
 ###############################################################################
 # Configure Files
 ###############################################################################
-GPLUGIN_GTK4_H_INCLUDES = ''
+GPLUGIN_GTK4_H_INCLUDES = []
 foreach header : GPLUGIN_GTK4_HEADERS
-	GPLUGIN_GTK4_H_INCLUDES = '@0@\n#include <gplugin-gtk4/@1@>'.format(
-		GPLUGIN_GTK4_H_INCLUDES,
-		header)
+	GPLUGIN_GTK4_H_INCLUDES += f'#include <gplugin-gtk4/@header@>'
 endforeach
 
 conf = configuration_data()
-conf.set('GPLUGIN_GTK_H_INCLUDES', GPLUGIN_GTK4_H_INCLUDES)
+conf.set('GPLUGIN_GTK_H_INCLUDES', '\n'.join(GPLUGIN_GTK4_H_INCLUDES))
 gplugin_gtk4_h = configure_file(
 	input : 'gplugin-gtk.h.in',
 	output : 'gplugin-gtk.h',
diff --git a/gplugin/meson.build b/gplugin/meson.build
--- a/gplugin/meson.build
+++ b/gplugin/meson.build
@@ -116,15 +116,13 @@ GPLUGIN_PUBLIC_BUILT_HEADERS += [
 gplugin_inc = include_directories('.')
 
 # Build gplugin.h
-GPLUGIN_H_INCLUDES = ''
+GPLUGIN_H_INCLUDES = []
 foreach header : GPLUGIN_HEADERS + ['gplugin-version-defs.h', 'gplugin-enums.h']
-	GPLUGIN_H_INCLUDES = '@0@\n#include <gplugin/@1@>'.format(
-		GPLUGIN_H_INCLUDES,
-		header)
+	GPLUGIN_H_INCLUDES += f'#include <gplugin/@header@>'
 endforeach
 
 conf = configuration_data()
-conf.set('GPLUGIN_H_INCLUDES', GPLUGIN_H_INCLUDES)
+conf.set('GPLUGIN_H_INCLUDES', '\n'.join(GPLUGIN_H_INCLUDES))
 gplugin_h = configure_file(
 	input : 'gplugin.h.in',
 	output : 'gplugin.h',
@@ -133,15 +131,13 @@ gplugin_h = configure_file(
 	install_dir : get_option('includedir') / 'gplugin-1.0')
 
 # Build gplugin-native.h
-GPLUGIN_NATIVE_H_INCLUDES = ''
+GPLUGIN_NATIVE_H_INCLUDES = []
 foreach header : GPLUGIN_NATIVE_HEADERS
-	GPLUGIN_NATIVE_H_INCLUDES = '@0@\n#include <gplugin/@1@>'.format(
-		GPLUGIN_NATIVE_H_INCLUDES,
-		header)
+	GPLUGIN_NATIVE_H_INCLUDES += f'#include <gplugin/@header@>'
 endforeach
 
 conf = configuration_data()
-conf.set('GPLUGIN_NATIVE_H_INCLUDES', GPLUGIN_NATIVE_H_INCLUDES)
+conf.set('GPLUGIN_NATIVE_H_INCLUDES', '\n'.join(GPLUGIN_NATIVE_H_INCLUDES))
 gplugin_native_h = configure_file(
 	input : 'gplugin-native.h.in',
 	output : 'gplugin-native.h',
diff --git a/gplugin/tests/meson.build b/gplugin/tests/meson.build
--- a/gplugin/tests/meson.build
+++ b/gplugin/tests/meson.build
@@ -12,163 +12,90 @@ subdir('plugins')
 subdir('unresolved-symbol')
 subdir('versioned-dependencies')
 
-###############################################################################
-# Tests
-###############################################################################
-
 # Add the normal plugins to the plugin path envvar
 devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir() / 'plugins')
 
 #######################################
 # Simple Tests (single file)
 #######################################
-e = executable('test-core', 'test-core.c',
-	c_args : [
-		'-DTEST_DIR="@0@/plugins/"'.format(
-			meson.current_build_dir()),
-		'-DTEST_ID_DIR="@0@/id-collision/"'.format(
-			meson.current_build_dir()),
-	],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Core', e)
-
-e = executable('test-find-plugins', 'test-find-plugins.c',
-	c_args : ['-DTEST_DIR="@0@/plugins/"'.format(meson.current_build_dir())],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Find Plugins', e)
-
-e = executable('test-id-normalize', 'test-id-normalize.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('ID Normalization', e)
-
-e = executable('test-loader', 'test-loader.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Loader', e)
-
-e = executable('test-loader-registration', 'test-loader-registration.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Loader Registration', e)
+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/"',
+  ],
+  'id-normalize': [],
+  'loader': [],
+  'loader-registration': [],
+  'newest-version': [
+    f'-DTEST_DIR="@current_build_dir@/newest-version/"',
+  ],
+  'option-group': [],
+  'plugin-manager-paths': [],
+  'plugin-info': [],
+  'signals': [
+    f'-DTEST_DIR="@current_build_dir@/plugins/"',
+  ],
+  'source': [],
+  'unresolved-symbol': [
+    f'-DPLUGIN_DIR="@current_build_dir@/unresolved-symbol/"',
+  ],
+  'version-compare': [],
+  'versioned-dependencies': [
+    f'-DTEST_VERSIONED_DEPENDENCY_DIR="@current_build_dir@/versioned-dependencies"',
+  ],
+}
 
-e = executable('test-newest-version', 'test-newest-version.c',
-	c_args : ['-DTEST_DIR="@0@/newest-version/"'.format(meson.current_build_dir())],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Find Plugins Newest Version', e)
-
-e = executable('test-option-group', 'test-option-group.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Option Group', e)
-
-e = executable('test-plugin-manager-paths', 'test-plugin-manager-paths.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Plugin Manager Paths', e)
-
-e = executable('test-plugin-info', 'test-plugin-info.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Plugin Info', e)
-
-e = executable('test-signals', 'test-signals.c',
-	c_args : ['-DTEST_DIR="@0@/plugins/"'.format(meson.current_build_dir())],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Signals', e)
-
-e = executable('test-source', 'test-source.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Source', e)
-
-e = executable('test-version-compare', 'test-version-compare.c',
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Version Compare', e)
-
-#######################################
-# Dynamic Type
-#######################################
 # 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'
-e = executable('test-dynamic-type', 'test-dynamic-type.c',
-	c_args : [
-		'-DTEST_DYNAMIC_DIR="@0@/dynamic-type/"'.format(
-			meson.current_build_dir())
-	],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Dynamic Type', e)
+TESTS += {
+  'dynamic-type': [
+    f'-DTEST_DYNAMIC_DIR="@current_build_dir@/dynamic-type/"',
+  ],
+}
 endif
 
-#######################################
-# ID Collision
-#######################################
-e = executable('test-id-collision', 'test-id-collision.c',
-	c_args : [
-		'-DTEST_ID_DIR="@0@/id-collision/"'.format(
-			meson.current_build_dir()),
-	],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('ID Collision', e)
+###############################################################################
+# Tests
+###############################################################################
 
-#######################################
-# Auto Load
-#######################################
-e = executable('test-auto-load', 'test-auto-load.c',
-	c_args : [
-		'-DTEST_DIR="@0@/plugins/"'.format(
-			meson.current_build_dir()),
-		'-DTEST_AUTO_LOAD_PASS_DIR="@0@/auto-load-pass"'.format(
-			meson.current_build_dir()),
-		'-DTEST_AUTO_LOAD_FAIL_DIR="@0@/auto-load-fail"'.format(
-			meson.current_build_dir())
-	],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Auto Load', e)
-
-#######################################
-# Versioned Dependencies
-#######################################
-e = executable('test-versioned-dependencies', 'test-versioned-dependencies.c',
-	c_args : [
-		'-DTEST_VERSIONED_DEPENDENCY_DIR="@0@/versioned-dependencies"'.format(
-			meson.current_build_dir()),
-	],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Versioned Dependencies', e)
+foreach prog, c_args : TESTS
+	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)
+endforeach
 
 #######################################
 # Native Loader
 #######################################
 e = executable('test-native-loader', 'test-native-loader.c',
 	c_args : [
-		'-DTEST_DIR="@0@/plugins/"'.format(
-			meson.current_build_dir()),
-		'-DTEST_BAD_DIR="@0@/bad-plugins/"'.format(
-			meson.current_build_dir()),
-		'-DTEST_ID_DIR="@0@/id-collision/"'.format(
-			meson.current_build_dir()),
+		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/"',
 	],
 	link_with : gplugin_loader_tests,
 	dependencies : [gplugin_dep, GLIB, GOBJECT])
 test('Native Loader', e)
-
-###############################################################################
-# Bind Local
-###############################################################################
-e = executable('test-bind-global', 'test-bind-global.c',
-	c_args : [
-		'-DTEST_BIND_GLOBAL_DIR="@0@/bind-global/"'.format(
-			meson.current_build_dir()),
-		'-DTEST_BAD_DIR="@0@/bad-plugins/"'.format(
-			meson.current_build_dir()),
-		'-DTEST_ID_DIR="@0@/id-collision/"'.format(
-			meson.current_build_dir()),
-	],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-test('Bind Global', e)
-
-###############################################################################
-# Unresolved Symbol
-###############################################################################
-e = executable('test-unresolved-symbol', 'test-unresolved-symbol.c',
-	c_args : [
-		'-DPLUGIN_DIR="@0@/unresolved-symbol/"'.format(
-			meson.current_build_dir()),
-	],
-	dependencies : [gplugin_dep, GLIB, GOBJECT])
-# test('Unresolved Symbol', e)
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
@@ -1,35 +1,15 @@
-shared_module('multiple-semantic-1.0.0', 'multiple-semantic-1.0.0.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_module('multiple-semantic-1.1.0', 'multiple-semantic-1.1.0.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_module('no-version-and-semantic-no-version',
-	'no-version-and-semantic-no-version.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_module('no-version-and-semantic-semantic',
-	'no-version-and-semantic-semantic.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
+MODULES = [
+  'multiple-semantic-1.0.0',
+  'multiple-semantic-1.1.0',
+  'no-version-and-semantic-no-version',
+  'no-version-and-semantic-semantic',
+  'non-semantic-and-semantic-non-semantic',
+  'non-semantic-and-semantic-semantic',
+  'solo-no-version',
+  'solo-non-semantic',
+]
 
-shared_module('non-semantic-and-semantic-non-semantic',
-	'non-semantic-and-semantic-non-semantic.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_module('non-semantic-and-semantic-semantic',
-	'non-semantic-and-semantic-semantic.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_module('solo-no-version', 'solo-no-version.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_module('solo-non-semantic', 'solo-non-semantic.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
+foreach module : MODULES
+	shared_module(module, f'@module@.c',
+	              name_prefix: '', dependencies : [gplugin_dep, GLIB])
+endforeach
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
@@ -1,27 +1,14 @@
-shared_library('basic-plugin', 'basic-plugin.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('dependent-plugin', 'dependent-plugin.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('broken-dependent-plugin', 'broken-dependent-plugin.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
+LIBRARIES = [
+  'basic-plugin',
+  'dependent-plugin',
+  'broken-dependent-plugin',
+  'load-failed',
+  'load-exception',
+  'unload-failed',
+  'unload-shutdown',
+]
 
-shared_library('load-failed', 'load-failed.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('load-exception', 'load-exception.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('unload-failed', 'unload-failed.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('unload-shutdown', 'unload-shutdown.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
+foreach lib : LIBRARIES
+	shared_library(lib, f'@lib@.c',
+	               name_prefix: '', dependencies : [gplugin_dep, GLIB])
+endforeach
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
@@ -1,43 +1,18 @@
-shared_library('super-dependent', 'super-dependent.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('no-version', 'no-version.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('exact1', 'exact1.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('exact2', 'exact2.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('greater', 'greater.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
+LIBRARIES = [
+  'super-dependent',
+  'no-version',
+  'exact1',
+  'exact2',
+  'greater',
+  'greater-equal',
+  'less',
+  'less-equal',
+  'bar',
+  'baz',
+  'fez',
+]
 
-shared_library('greater-equal', 'greater-equal.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('less', 'less.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('less-equal', 'less-equal.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('bar', 'bar.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('baz', 'baz.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
-
-shared_library('fez', 'fez.c',
-	name_prefix : '',
-	dependencies : [gplugin_dep, GLIB])
+foreach lib : LIBRARIES
+	shared_library(lib, f'@lib@.c',
+	               name_prefix: '', dependencies : [gplugin_dep, GLIB])
+endforeach
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -70,9 +70,8 @@ meson.add_devenv(devenv)
 GETTEXT_PACKAGE = 'gplugin'
 LOCALE_DIR = get_option('prefix') / get_option('localedir')
 
-add_project_arguments('-DLOCALEDIR="@0@"'.format(LOCALE_DIR), language : 'c')
-add_project_arguments('-DGETTEXT_PACKAGE="@0@"'.format(GETTEXT_PACKAGE),
-	language : 'c')
+add_project_arguments(f'-DLOCALEDIR="@LOCALE_DIR@"', language : 'c')
+add_project_arguments(f'-DGETTEXT_PACKAGE="@GETTEXT_PACKAGE@"', language : 'c')
 
 if get_option('nls')
 	i18n = import('i18n')
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
@@ -1,23 +1,16 @@
-if get_option('vapi')
-	shared_library('genie-basic-plugin', 'basic.gs',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('genie-dependent-plugin', 'dependent.gs',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('load-exception-plugin', 'load-exception.gs',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('load-failed-plugin', 'load-failed.gs',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('unload-shutdown-plugin', 'unload-shutdown.gs',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('unload-failed-plugin', 'unload-failed.gs',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
+LIBRARIES = [
+  'basic',
+  'dependent',
+  'load-exception',
+  'load-failed',
+  'unload-shutdown',
+  'unload-failed',
+]
 
-	# Add the test plugins path to our environment variable
-	devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir())
-endif # vapi
+foreach lib : LIBRARIES
+	shared_library(f'genie-@lib@-plugin', f'@lib@.gs',
+	               name_prefix: '', dependencies : [gplugin_dep, gplugin_vapi])
+endforeach
+
+# Add the test plugins path to our environment variable
+devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir())
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
@@ -1,23 +1,16 @@
-if get_option('vapi')
-	shared_library('vala-basic-plugin', 'basic.vala',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('vala-dependent-plugin', 'dependent.vala',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('vala-load-exception', 'load-exception.vala',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('vala-load-failed', 'load-failed.vala',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('vala-unload-failed', 'unload-failed.vala',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
-	shared_library('vala-unload-shutdown', 'unload-shutdown.vala',
-		name_prefix : '',
-		dependencies : [gplugin_dep, gplugin_vapi])
+LIBRARIES = [
+  'basic',
+  'dependent',
+  'load-exception',
+  'load-failed',
+  'unload-failed',
+  'unload-shutdown',
+]
 
-	# Add the test plugins path to our environment variable
-	devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir())
-endif # vapi
+foreach lib : LIBRARIES
+	shared_library(f'vala-@lib@-plugin', f'@lib@.vala',
+	               name_prefix: '', dependencies: [gplugin_dep, gplugin_vapi])
+endforeach
+
+# Add the test plugins path to our environment variable
+devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir())
