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',
]
pluginsdirs = [ ]
# FIXME: Use if not gst_dep.is_internal() when avalaible as we only support the
# case where GStreamer is another subproject here.
if not meson.is_subproject()
pkgconfig = find_program('pkg-config')
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
pluginsdirs = []
if gst_dep.type_name() == 'pkgconfig'
pbase = dependency('gstreamer-plugins-base-' + api_version, required : false)
pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
pbase.get_pkgconfig_variable('pluginsdir')]
endif
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('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
'gst-plugins-good', 'gst-plugins-ugly@' + meson.build_root(), separator: ':')
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
foreach plugindir: pluginsdirs
env.append('GST_PLUGIN_PATH_1_0', plugindir)
endforeach
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))
test(test_name, exe, env: env, timeout: 3 * 60)
endif