gplugin/gplugin

Add a doc check unit test to gplugin-gtk and fix the issues it found

Testing Done:
Ran the unit tests

Reviewed at https://reviews.imfreedom.org/r/3040/
all_native_test_plugins = {}
###############################################################################
# Subdirectories
###############################################################################
subdir('bad-plugins')
subdir('bind-global')
subdir('dynamic-type')
subdir('id-collision')
subdir('auto-load-fail')
subdir('auto-load-pass')
subdir('newest-version')
subdir('plugins')
subdir('unresolved-symbol')
subdir('versioned-dependencies')
# Add the normal plugins to the plugin path envvar
devenv.append('GPLUGIN_PLUGIN_PATH', meson.current_build_dir() / 'plugins')
#######################################
# Simple Tests (single file)
#######################################
current_build_dir = meson.current_build_dir()
TESTS = {
# 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': ['newest-version'],
'option-group': [],
'plugin-manager-paths': [],
'plugin-info': [],
'signals': ['plugins'],
'source': [],
'version-compare': [],
'versioned-dependencies': ['versioned-dependencies'],
}
# These libs are not built on Windows so no need to test them there either.
if host_machine.system() != 'windows'
TESTS += {
'dynamic-type': ['dynamic-type'],
'unresolved-symbol': ['unresolved-symbol'],
}
endif
###############################################################################
# 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,
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 : c_args,
link_with : gplugin_loader_tests,
dependencies : [gplugin_dep, GLIB, GOBJECT])
test('Native loader', e,
depends: depends)