mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
meson: Add testsuite
This commit is contained in:
parent
21f8b168d3
commit
490028ba21
3 changed files with 32 additions and 1 deletions
|
@ -54,6 +54,7 @@ configinc = include_directories('.')
|
|||
|
||||
subdir('gi')
|
||||
subdir('plugin')
|
||||
subdir('testsuite')
|
||||
|
||||
python3 = find_program('python3')
|
||||
run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
|
||||
|
|
30
testsuite/meson.build
Normal file
30
testsuite/meson.build
Normal file
|
@ -0,0 +1,30 @@
|
|||
runtests = find_program('runtests.py')
|
||||
|
||||
tests = [
|
||||
['Test gst', 'test_gst.py'],
|
||||
['Test fractions', 'test_fraction.py']
|
||||
]
|
||||
|
||||
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
|
||||
|
||||
foreach i: tests
|
||||
test_name = i.get(0)
|
||||
env = environment()
|
||||
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
|
||||
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
|
||||
foreach plugindir: pluginsdirs
|
||||
env.append('GST_PLUGIN_PATH_1_0', plugindir)
|
||||
endforeach
|
||||
env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), i.get(1)))
|
||||
test(test_name, runtests, args: [i.get(1)], env: env)
|
||||
endforeach
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# -*- Mode: Python -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue