diff options
authorTim-Philipp Müller <>2020-05-27 14:42:20 +0100
committerTim-Philipp Müller <>2020-05-27 14:55:11 +0100
commit4063a319c5a7a3ffe23047c378ec19b2b9ed2ef5 (patch)
parent887416db4b0012a85dffc19baa50812de40732c1 (diff)
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner
If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <>
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/check/ b/tests/check/
index 306791d5..2c3ecb11 100644
--- a/tests/check/
+++ b/tests/check/
@@ -23,10 +23,14 @@ test_defines = [
pluginsdirs = []
if gst_dep.type_name() == 'pkgconfig'
- pbase = dependency('gstreamer-plugins-base-' + api_version, required : false)
+ pbase = dependency('gstreamer-plugins-base-' + api_version, required: true)
pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
+ gst_plugin_scanner_dir = gst_dep.get_pkgconfig_variable('pluginscannerdir')
+ gst_plugin_scanner_dir = subproject('gstreamer').get_variable('gst_scanner_dir')
+gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
test_deps = [gst_dep, gstbase_dep, gstcheck_dep, gstaudio_dep, gstapp_dep,
gstfft_dep, gstvideo_dep, gstpbutils_dep]
@@ -70,8 +74,8 @@ foreach t : ugly_tests
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
'gst-plugins-good', 'gst-plugins-ugly@' + meson.build_root())
env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
- env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
+ env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
test(test_name, exe, env: env, timeout: 3 * 60)