webrtcbin: an element that handles the transport aspects of webrtc connections
[platform/upstream/gst-plugins-bad.git] / tests / check / meson.build
1 have_registry = true # FIXME not get_option('disable_registry')
2
3 libparser = static_library('parser',
4   'elements/parser.c',
5   install : false,
6   dependencies : [gst_dep, gstcheck_dep],
7 )
8
9 libparser_dep = declare_dependency(link_with: libparser,
10   sources: ['elements/parser.h'])
11
12 exif_dep = dependency('libexif', version : '>= 0.6.16', required : false)
13
14 enable_gst_player_tests = get_option('enable_gst_player_tests')
15
16 # name, condition when to skip the test and extra dependencies
17 base_tests = [
18   [['elements/aiffparse.c']],
19   [['elements/asfmux.c']],
20   [['elements/assrender.c'], not ass_dep.found(), [ass_dep]],
21   [['elements/audiointerleave.c']],
22   [['elements/audiomixer.c']],
23   [['elements/autoconvert.c']],
24   [['elements/autovideoconvert.c']],
25   [['elements/camerabin.c']],
26   [['elements/compositor.c']],
27   [['elements/curlhttpsink.c'], not curl_dep.found(), [curl_dep]],
28   [['elements/curlfilesink.c'], not curl_dep.found(), [curl_dep]],
29   [['elements/curlftpsink.c'], not curl_dep.found(), [curl_dep]],
30   [['elements/curlsmtpsink.c'], not curl_dep.found(), [curl_dep]],
31   [['elements/dash_mpd.c'], not xml2_dep.found(), [xml2_dep]],
32   [['elements/faac.c'], not faac_dep.found() or not cc.has_header_symbol('faac.h', 'faacEncOpen'), [faac_dep]],
33   [['elements/faad.c'], not faad_dep.found() or not have_faad_2_7, [faad_dep]],
34   [['elements/gdpdepay.c']],
35   [['elements/gdppay.c']],
36   [['elements/h263parse.c'], false, [libparser_dep]],
37   [['elements/h264parse.c'], false, [libparser_dep]],
38   [['elements/id3mux.c']],
39   [['elements/jifmux.c'], not exif_dep.found(), [exif_dep]],
40   [['elements/jpegparse.c']],
41   [['elements/kate.c'], not kate_dep.found(), [kate_dep]],
42   [['elements/mpeg4videoparse.c'], false, [libparser_dep]],
43   [['elements/mpegtsmux.c']],
44   [['elements/mpegvideoparse.c'], false, [libparser_dep]],
45   [['elements/mssdemux.c', 'elements/test_http_src.c', 'elements/adaptive_demux_engine.c', 'elements/adaptive_demux_common.c'], not xml28_dep.found(), [xml28_dep]],
46   [['elements/mxfdemux.c']],
47   [['elements/mxfmux.c']],
48   [['elements/netsim.c']],
49   [['elements/pcapparse.c'], false, [libparser_dep]],
50   [['elements/pnm.c']],
51   [['elements/schroenc.c'], not schro_dep.found(), [schro_dep]],
52   [['elements/shm.c'], not shm_enabled, shm_deps],
53   [['elements/rtponvifparse.c']],
54   [['elements/rtponviftimestamp.c']],
55   [['elements/videoframe-audiolevel.c']],
56   [['elements/viewfinderbin.c']],
57   [['elements/voaacenc.c'], not voaac_dep.found(), [voaac_dep]],
58   [['elements/webrtcbin.c'], not libnice_dep.found(), [gstwebrtc_dep]],
59   [['elements/x265enc.c'], not x265_dep.found(), [x265_dep]],
60   [['elements/zbar.c'], not zbar_dep.found(), [zbar_dep]],
61   [['libs/h264parser.c'], false, [gstcodecparsers_dep]],
62   [['libs/insertbin.c'], false, [gstinsertbin_dep]],
63   [['libs/isoff.c'], not xml2_dep.found(), [gstisoff_dep, xml2_dep]],
64   [['libs/mpegts.c'], false, [gstmpegts_dep]],
65   [['libs/mpegvideoparser.c'], false, [gstcodecparsers_dep]],
66   [['libs/player.c'], not enable_gst_player_tests, [gstplayer_dep]],
67   [['libs/vc1parser.c'], false, [gstcodecparsers_dep]],
68   [['libs/vp8parser.c'], false, [gstcodecparsers_dep]],
69 ]
70
71 test_defines = [
72   '-UG_DISABLE_ASSERT',
73   '-UG_DISABLE_CAST_CHECKS',
74   '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
75   '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
76   '-DTEST_PATH="' + meson.current_build_dir() + '/media"',
77   '-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data',
78   '-DGST_USE_UNSTABLE_API',
79 ]
80
81 test_deps = [gst_dep, gstapp_dep, gstbase_dep,
82              gstbasecamerabin_dep, gstphotography_dep,
83              gstpbutils_dep, gstcontroller_dep, gstaudio_dep,
84              gstvideo_dep, gstrtp_dep, gsturidownloader_dep,
85              gstcheck_dep, gio_dep, glib_dep, gsttag_dep]
86
87 pluginsdirs = [  ]
88
89 if gst_dep.type_name() == 'pkgconfig'
90   pbase = dependency('gstreamer-plugins-base-' + api_version)
91
92   pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir')] + [pbase.get_pkgconfig_variable('pluginsdir')]
93 endif
94
95 foreach t : base_tests
96   fnames = t.get(0)
97   test_name = fnames[0].split('.').get(0).underscorify()
98   skip_test = false
99   extra_deps = [ ]
100
101   if t.length() >= 3
102     extra_deps = t.get(2)
103   endif
104
105   if t.length() >= 2
106     skip_test = t.get(1)
107   endif
108
109   if not skip_test
110     exe = executable(test_name, fnames,
111       include_directories : [configinc],
112       c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
113       cpp_args : gst_plugins_bad_args,
114       dependencies : [libm] + test_deps + extra_deps,
115     )
116
117     env = environment()
118     env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
119     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
120     env.set('CK_DEFAULT_TIMEOUT', '20')
121     env.set('GST_STATE_IGNORE_ELEMENTS', '')
122     env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
123     env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
124     test(test_name, exe, env: env, timeout: 3 * 60)
125   endif
126 endforeach
127
128 if enable_gst_player_tests
129   subdir ('media')
130 endif