614799226ca9f3d8e8e1bbb6167edbcb94861e29
[platform/upstream/gst-editing-services.git] / tests / check / meson.build
1 # tests and condition when to skip the test
2 ges_tests = [
3     ['ges/asset'],
4     ['ges/backgroundsource'],
5     ['ges/basic'],
6     ['ges/layer'],
7     ['ges/effects'],
8     ['ges/uriclip'],
9     ['ges/clip'],
10     ['ges/timelineedition'],
11     ['ges/titles'],
12     ['ges/transition'],
13     ['ges/overlays'],
14     ['ges/mixers'],
15     ['ges/group'],
16     ['ges/project'],
17     ['ges/track'],
18     ['ges/tempochange'],
19     ['ges/negative'],
20     ['nle/simple'],
21     ['nle/complex'],
22     ['nle/nleoperation'],
23     ['nle/nlecomposition'],
24     ['nle/tempochange']
25 ]
26
27 test_defines = [
28   '-UG_DISABLE_ASSERT',
29   '-UG_DISABLE_CAST_CHECKS',
30   '-DGES_TEST_FILES_PATH="' + meson.current_source_dir() + '/ges/"',
31   '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
32   '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
33   '-DGST_USE_UNSTABLE_API',
34 ]
35
36 pluginsdirs = []
37 if gst_dep.type_name() == 'pkgconfig'
38   pbase = dependency('gstreamer-plugins-base-' + apiversion, required : false)
39   pbad = dependency('gstreamer-plugins-bad-' + apiversion, required : false)
40
41   pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
42                  pbase.get_pkgconfig_variable('pluginsdir'),
43                  pbad.get_pkgconfig_variable('pluginsdir')]
44 endif
45
46 foreach t : ges_tests
47   fname = '@0@.c'.format(t.get(0))
48   test_name = t.get(0).underscorify()
49   if t.length() == 2
50     skip_test = t.get(1)
51   else
52     skip_test = false
53   endif
54
55   if not skip_test
56     env = environment()
57     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
58     env.set('GST_STATE_IGNORE_ELEMENTS', '')
59     env.set('CK_DEFAULT_TIMEOUT', '20')
60     env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
61     env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
62
63     exe = executable(test_name, fname,
64         'ges/test-utils.c', 'nle/common.c',
65         c_args : ges_c_args + test_defines,
66         include_directories : [configinc],
67         dependencies : libges_deps + [gstcheck_dep, ges_dep],
68     )
69     test(test_name, exe, env: env, timeout : 3 * 60)
70   endif
71 endforeach
72
73 if build_gir
74   # Make sure to use the subproject gst-validate-launcher if avalaible.
75   if gstvalidate_dep.found() and gstvalidate_dep.type_name() == 'internal'
76     runtests = subproject('gst-devtools').get_variable('launcher')
77   else
78     runtests = find_program('gst-validate-launcher', required : false)
79   endif
80
81   if runtests.found()
82     test('pythontests', runtests, args: ['--pyunittest-dir', meson.current_source_dir(), 'pyunittest', '--dump-on-failure'],
83          env: env)
84   endif
85 endif