tests: Simple test to use gst-full in python
[platform/upstream/gstreamer.git] / tests / python / meson.build
1 gst_python = subproject('gst-python', required: false)
2 gir = find_program('g-ir-scanner', required : get_option('introspection'))
3 if not gst_python.found() or not gir.found()
4     message('Not running python devenv tests: gst_python: @0@ gir: @1@'.format(gst_python.found(), gir.found()))
5     subdir_done()
6 endif
7
8 root_rel = '../..'
9 python = import('python').find_installation()
10
11 if run_command(python, '-c', 'import gi').returncode() != 0
12     message('PyGObject not found, not running PyGObject tests')
13     subdir_done()
14 endif
15
16 test('python-overrides-devenv', setenv, args: ['--builddir=@0@'.format(meson.build_root()),
17               '--gstbuilddir=@0@'.format(meson.current_build_dir() / '..' / '..'),
18               '--srcdir=@0@'.format(meson.source_root()),
19               meson.current_source_dir() / 'python-devenv-overrides.py'])
20
21 env = environment()
22 env.set('GI_TYPELIB_PATH', meson.current_build_dir() / root_rel)
23 if build_machine.system() == 'windows'
24     env.append('PATH', meson.current_build_dir() / root_rel)
25 elif build_machine.system() == 'linux'
26     env.append('LD_LIBRARY_PATH', meson.current_build_dir() / root_rel)
27 else
28     env.append('DYLD_LIBRARY_PATH', meson.current_build_dir() / root_rel)
29 endif
30
31 env.set('GST_OVERRIDE_SRC_PATH', meson.current_source_dir() / root_rel / 'subprojects/gst-python/gi/overrides')
32 env.set('GST_OVERRIDE_BUILD_PATH', meson.current_build_dir() / root_rel / 'subprojects/gst-python/gi/overrides')
33
34 test('python-full', python, args: [meson.current_source_dir() / 'python-full.py'], env: env)