b377cb1d0798d3ab65d19a80c97e3c7b627a65ed
[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     ['ges/markerlist'],
21     ['nle/simple'],
22     ['nle/complex'],
23     ['nle/nleoperation'],
24     ['nle/nlecomposition'],
25     ['nle/tempochange']
26 ]
27
28 test_defines = [
29   '-UG_DISABLE_ASSERT',
30   '-UG_DISABLE_CAST_CHECKS',
31   '-DGES_TEST_FILES_PATH="@0@"'.format(join_paths(meson.current_source_dir(), 'assets')),
32   '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
33   '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
34   '-DGST_USE_UNSTABLE_API',
35 ]
36
37 pluginsdirs = []
38 if gst_dep.type_name() == 'pkgconfig'
39   pbase = dependency('gstreamer-plugins-base-' + apiversion, required : false)
40   pbad = dependency('gstreamer-plugins-bad-' + apiversion, required : false)
41
42   pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
43                  pbase.get_pkgconfig_variable('pluginsdir'),
44                  pbad.get_pkgconfig_variable('pluginsdir')]
45 endif
46
47 foreach t : ges_tests
48   fname = '@0@.c'.format(t.get(0))
49   test_name = t.get(0).underscorify()
50   if t.length() == 2
51     skip_test = t.get(1)
52   else
53     skip_test = false
54   endif
55
56   if not skip_test
57     env = environment()
58     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
59     env.set('GST_STATE_IGNORE_ELEMENTS', '')
60     env.set('CK_DEFAULT_TIMEOUT', '20')
61     env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
62     env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
63
64     exe = executable(test_name, fname,
65         'ges/test-utils.c', 'nle/common.c',
66         c_args : ges_c_args + test_defines,
67         include_directories : [configinc],
68         dependencies : libges_deps + [gstcheck_dep, ges_dep],
69     )
70     test(test_name, exe, env: env, timeout : 3 * 60)
71   endif
72 endforeach
73
74 if gstvalidate_dep.found()
75   # filename: is .validatetest
76   scenarios = {
77     'check_video_track_restriction_scale': false,
78     'check_video_track_restriction_scale_with_keyframes': false,
79     'check_edit_in_frames': false,
80     'check_edit_in_frames_with_framerate_mismatch': false,
81     'check_layer_activness_gaps': false,
82     'seek_with_stop': true,
83     'seek_with_stop.check_clock_sync': true,
84     'edit_while_seeked_with_stop': true,
85     'complex_effect_bin_desc': true,
86   }
87
88   foreach scenario, is_validatetest: scenarios
89
90     env = environment()
91     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
92     env.set('GST_STATE_IGNORE_ELEMENTS', '')
93     env.set('CK_DEFAULT_TIMEOUT', '20')
94     env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), 'scenarios'))
95     env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
96     env.set('GST_VALIDATE_LOGSDIR', meson.current_build_dir() / scenario)
97
98     if is_validatetest
99       testfile = meson.current_source_dir() / 'scenarios' / scenario + '.validatetest'
100       test(scenario, ges_launch, env: env, args: ['--set-test-file', testfile, '--mute'])
101     else
102       scenario_file = meson.current_source_dir() / 'scenarios' / scenario + '.scenario'
103       test(scenario, ges_launch, env: env, args: ['--set-scenario', scenario_file])
104     endif
105
106   endforeach
107   test('simple_playback_test', ges_launch, env: env, args: ['+test-clip', 'blue', 'd=0.1', '--disable-validate', '--videosink=fakevideosink', '--audiosink=fakesink'])
108 endif
109
110 if build_gir
111   # Make sure to use the subproject gst-validate-launcher if available.
112   if gstvalidate_dep.found() and gstvalidate_dep.type_name() == 'internal'
113     runtests = subproject('gst-devtools').get_variable('launcher')
114   else
115     runtests = find_program('gst-validate-launcher', required : false)
116   endif
117
118   if runtests.found()
119     test('pythontests', runtests, args: ['--pyunittest-dir', meson.current_source_dir(), 'pyunittest', '--dump-on-failure'],
120          env: env)
121   endif
122 endif