meson.build 2.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# tests and condition when to skip the test
ges_tests = [
    ['ges/asset'],
    ['ges/backgroundsource'],
    ['ges/basic'],
    ['ges/layer'],
    ['ges/effects'],
    ['ges/uriclip'],
    ['ges/clip'],
    ['ges/timelineedition'],
    ['ges/titles'],
    ['ges/transition'],
    ['ges/overlays'],
    ['ges/mixers'],
    ['ges/group'],
    ['ges/project'],
    ['ges/track'],
    ['ges/tempochange'],
    ['nle/simple'],
    ['nle/complex'],
    ['nle/nleoperation'],
    ['nle/nlecomposition'],
    ['nle/tempochange']
]

test_defines = [
  '-UG_DISABLE_ASSERT',
  '-UG_DISABLE_CAST_CHECKS',
29
  '-DGES_TEST_FILES_PATH="' + meson.current_source_dir() + '/ges/"',
30
31
32
33
34
  '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
  '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
  '-DGST_USE_UNSTABLE_API',
]

35
pluginsdirs = []
36
37
38
if gst_dep.type_name() == 'pkgconfig'
  pbase = dependency('gstreamer-plugins-base-' + apiversion, required : false)
  pbad = dependency('gstreamer-plugins-bad-' + apiversion, required : false)
39

40
41
  pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
                 pbase.get_pkgconfig_variable('pluginsdir'),
42
                 pbad.get_pkgconfig_variable('pluginsdir')]
43
endif
44
45

foreach t : ges_tests
46
47
  fname = '@0@.c'.format(t.get(0))
  test_name = t.get(0).underscorify()
48
49
50
51
52
53
54
  if t.length() == 2
    skip_test = t.get(1)
  else
    skip_test = false
  endif

  if not skip_test
55
56
57
58
59
    env = environment()
    env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
    env.set('GST_STATE_IGNORE_ELEMENTS', '')
    env.set('CK_DEFAULT_TIMEOUT', '20')
    env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
60
    env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
61

62
    exe = executable(test_name, fname,
63
64
65
66
67
        'ges/test-utils.c', 'nle/common.c',
        c_args : ges_c_args + test_defines,
        include_directories : [configinc],
        dependencies : libges_deps + [gstcheck_dep, ges_dep],
    )
68
    test(test_name, exe, env: env)
69
70
  endif
endforeach
Thibault Saunier's avatar
Thibault Saunier committed
71
72

if build_gir
73
74
75
76
77
78
  # Make sure to use the subproject gst-validate-launcher if avalaible.
  if gstvalidate_dep.found() and gstvalidate_dep.type_name() == 'internal'
    runtests = subproject('gst-devtools').get_variable('launcher')
  else
    runtests = find_program('gst-validate-launcher', required : false)
  endif
Thibault Saunier's avatar
Thibault Saunier committed
79
80

  if runtests.found()
81
82
    test('pythontests', runtests, args: ['--pyunittest-dir', meson.current_source_dir(), 'pyunittest', '--dump-on-failure'],
         env: env)
Thibault Saunier's avatar
Thibault Saunier committed
83
84
  endif
endif