diff options
author | Thibault Saunier <thibault.saunier@osg.samsung.com> | 2016-11-03 08:36:23 -0300 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@osg.samsung.com> | 2016-11-04 11:40:10 -0300 |
commit | 490028ba21ca2905e52ff065a318d8f3f4822d6b (patch) | |
tree | 5f8cd71660f00f21fa8d9a0bf5b4438796a8f105 /testsuite | |
parent | 21f8b168d392515d855eb1b83703ad0914f5aec9 (diff) |
meson: Add testsuite
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/meson.build | 30 | ||||
-rw-r--r-- | testsuite/runtests.py | 2 |
2 files changed, 31 insertions, 1 deletions
diff --git a/testsuite/meson.build b/testsuite/meson.build new file mode 100644 index 0000000..84c0f3e --- /dev/null +++ b/testsuite/meson.build @@ -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 diff --git a/testsuite/runtests.py b/testsuite/runtests.py index 452311f..f84ace2 100644 --- a/testsuite/runtests.py +++ b/testsuite/runtests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # |