2018-05-14 08:05:15 +00:00
|
|
|
runtests = files('runtests.py')
|
2016-11-03 11:36:23 +00:00
|
|
|
|
|
|
|
tests = [
|
|
|
|
['Test gst', 'test_gst.py'],
|
2017-07-25 18:29:19 +00:00
|
|
|
['Test fundamentals', 'test_types.py'],
|
2017-05-21 15:03:48 +00:00
|
|
|
['Test plugins', 'test_plugin.py'],
|
2016-11-03 11:36:23 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
pluginsdirs = []
|
|
|
|
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
|
|
|
|
endif
|
|
|
|
|
2018-05-14 08:05:15 +00:00
|
|
|
runcmd = run_command(python, '-c', '''with open("@0@/mesonconfig.py", "w") as f:
|
2017-07-25 20:18:26 +00:00
|
|
|
f.write("path='@1@'")'''.format(
|
2018-05-14 08:05:15 +00:00
|
|
|
join_paths(meson.current_build_dir()), join_paths(meson.current_build_dir(), '..')))
|
2017-07-25 20:18:26 +00:00
|
|
|
|
|
|
|
if runcmd.returncode() != 0
|
|
|
|
error('Could not configure testsuite config file.' + runcmd.stderr())
|
|
|
|
endif
|
|
|
|
|
2017-05-21 15:03:48 +00:00
|
|
|
pluginsdirs = []
|
|
|
|
if gst_dep.type_name() == 'pkgconfig'
|
|
|
|
pbase = dependency('gstreamer-plugins-base-' + api_version, required : false)
|
2021-10-17 23:40:14 +00:00
|
|
|
pluginsdirs = [gst_dep.get_variable('pluginsdir'),
|
|
|
|
pbase.get_variable('pluginsdir')]
|
2017-05-21 15:03:48 +00:00
|
|
|
endif
|
|
|
|
|
2021-10-18 14:47:00 +00:00
|
|
|
pypluginsdir = [join_paths (meson.project_build_root(), 'plugin'), meson.current_source_dir()]
|
2017-05-21 15:03:48 +00:00
|
|
|
|
2016-11-03 11:36:23 +00:00
|
|
|
foreach i: tests
|
|
|
|
test_name = i.get(0)
|
|
|
|
env = environment()
|
2018-10-30 23:41:31 +00:00
|
|
|
env.set('GST_OVERRIDE_SRC_PATH', join_paths (meson.current_source_dir(), '..', 'gi', 'overrides'))
|
|
|
|
env.set('GST_OVERRIDE_BUILD_PATH', join_paths (meson.current_build_dir(), '..', 'gi', 'overrides'))
|
2021-10-18 14:47:00 +00:00
|
|
|
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
|
|
|
|
'gst-python@' + meson.project_build_root())
|
|
|
|
env.set('GST_PLUGIN_PATH_1_0', meson.global_build_root(), pluginsdirs + pypluginsdir)
|
2017-05-21 15:03:48 +00:00
|
|
|
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
|
2018-05-14 08:05:15 +00:00
|
|
|
test(test_name, python, args: [runtests, i.get(1)], env: env)
|
2016-11-03 11:36:23 +00:00
|
|
|
endforeach
|