summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2020-05-27 15:17:12 +0100
committerTim-Philipp Müller <tim@centricular.com>2020-05-27 15:17:12 +0100
commit690f8d30acea9acfbe032986800d96b8a7e71034 (patch)
tree865ea2636c1ec31cd1e373f88b727da83df246c1 /tests
parent7b5f99b47adad8c7815d494825c09d7a03ef8782 (diff)
downloadgstreamer-plugins-bad-690f8d30acea9acfbe032986800d96b8a7e71034.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1302>
Diffstat (limited to 'tests')
-rw-r--r--tests/check/meson.build8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/check/meson.build b/tests/check/meson.build
index c305fd49b..bfe87a04d 100644
--- a/tests/check/meson.build
+++ b/tests/check/meson.build
@@ -147,8 +147,13 @@ pluginsdirs = [ ]
if gst_dep.type_name() == 'pkgconfig'
pbase = dependency('gstreamer-plugins-base-' + api_version)
- pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir')] + [pbase.get_pkgconfig_variable('pluginsdir')]
+ pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
+ pbase.get_pkgconfig_variable('pluginsdir')]
+ gst_plugin_scanner_dir = gst_dep.get_pkgconfig_variable('pluginscannerdir')
+else
+ gst_plugin_scanner_dir = subproject('gstreamer').get_variable('gst_scanner_dir')
endif
+gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
foreach t : base_tests
fnames = t.get(0)
@@ -183,6 +188,7 @@ foreach t : base_tests
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
'gst-plugins-good', 'gst-plugins-ugly','gst-libav', 'libnice',
'gst-plugins-bad@' + meson.build_root())
+ env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
test(test_name, exe, env: env, timeout: 3 * 60)
endif
endforeach