meson: test: Fix environment object usage

And use get_pkgconfig_variable instead of calling pkg-config ourself
This commit is contained in:
Thibault Saunier 2017-03-28 14:18:38 -03:00
parent fac622571c
commit 18d84dfa23

View File

@ -17,18 +17,11 @@ test_defines = [
'-DGST_USE_UNSTABLE_API', '-DGST_USE_UNSTABLE_API',
] ]
pluginsdirs = [ ] pluginsdirs = []
# FIXME: Use if not gst_dep.is_internal() when avalaible as we only support the if gst_dep.type_name() == 'pkgconfig'
# case where GStreamer is another subproject here. pbase = dependency('gstreamer-plugins-base-' + api_version, required : false)
if not meson.is_subproject() pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
pkgconfig = find_program('pkg-config') pbase.get_pkgconfig_variable('pluginsdir')]
runcmd = run_command(pkgconfig, '--variable=pluginsdir', 'gstreamer-' + api_version)
if runcmd.returncode() == 0
pluginsdirs = runcmd.stdout().split()
else
error('Could not determine GStreamer core plugins directory for unit tests.')
endif
endif endif
test_deps = [gst_dep, gstbase_dep, gstcheck_dep, gstaudio_dep, gstapp_dep, gstfft_dep] test_deps = [gst_dep, gstbase_dep, gstcheck_dep, gstaudio_dep, gstapp_dep, gstfft_dep]
@ -60,11 +53,7 @@ foreach t : ugly_tests
env.set('CK_DEFAULT_TIMEOUT', '20') env.set('CK_DEFAULT_TIMEOUT', '20')
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base', env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
'gst-plugins-good', 'gst-plugins-ugly@' + meson.build_root(), separator: ':') 'gst-plugins-good', 'gst-plugins-ugly@' + meson.build_root(), separator: ':')
env.set('GST_PLUGIN_PATH_1_0', meson.build_root()) env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
foreach plugindir: pluginsdirs
env.append('GST_PLUGIN_PATH_1_0', plugindir)
endforeach
env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name)) env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
test(test_name, exe, env: env, timeout: 3 * 60) test(test_name, exe, env: env, timeout: 3 * 60)
endif endif