summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2017-03-28 14:18:38 -0300
committerThibault Saunier <thibault.saunier@osg.samsung.com>2017-03-28 14:20:50 -0300
commit18d84dfa2352f5db6dc4ed6bc7c4200a49647803 (patch)
treee61d70bfb25533dedc099c96694d7a626f81797d
parentfac622571c8a1b46ab1c1874da041a65997c15ce (diff)
meson: test: Fix environment object usage
And use get_pkgconfig_variable instead of calling pkg-config ourself
-rw-r--r--tests/check/meson.build23
1 files changed, 6 insertions, 17 deletions
diff --git a/tests/check/meson.build b/tests/check/meson.build
index 3c1a00ff..f4203039 100644
--- a/tests/check/meson.build
+++ b/tests/check/meson.build
@@ -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