1have_registry = true # FIXME get_option('registry') 2 3libparser = static_library('parser', 4 'elements/parser.c', 5 install : false, 6 dependencies : [gst_dep, gstcheck_dep], 7) 8 9libparser_dep = declare_dependency(link_with: libparser, 10 sources: ['elements/parser.h']) 11 12# FIXME: automagic 13exif_dep = dependency('libexif', version : '>= 0.6.16', required : false) 14 15enable_gst_player_tests = get_option('gst_player_tests') 16 17# Need explicit dependency listing for nvenc on Windows 18nvenc_test_deps = [] 19if cuda_dep.found() and cudart_dep.found() 20 nvenc_test_deps += [cuda_dep, cudart_dep, gmodule_dep, gstgl_dep] 21 if use_nvenc_gl 22 nvenc_test_deps += gstgl_dep 23 endif 24endif 25 26# name, condition when to skip the test and extra dependencies 27base_tests = [ 28 [['elements/aiffparse.c']], 29 [['elements/asfmux.c']], 30 [['elements/autoconvert.c']], 31 [['elements/autovideoconvert.c']], 32 [['elements/avwait.c']], 33 [['elements/camerabin.c']], 34 [['elements/gdpdepay.c']], 35 [['elements/gdppay.c']], 36 [['elements/h263parse.c'], false, [libparser_dep, gstcodecparsers_dep]], 37 [['elements/h264parse.c'], false, [libparser_dep, gstcodecparsers_dep]], 38 [['elements/id3mux.c']], 39 [['elements/mpegtsmux.c'], false, [gstmpegts_dep]], 40 [['elements/mpeg4videoparse.c'], false, [libparser_dep, gstcodecparsers_dep]], 41 [['elements/mpegvideoparse.c'], false, [libparser_dep, gstcodecparsers_dep]], 42 [['elements/msdkh264enc.c'], not have_msdk, [msdk_dep]], 43 [['elements/mxfdemux.c']], 44 [['elements/mxfmux.c']], 45 [['elements/nvenc.c'], not cuda_dep.found() or not cudart_dep.found(), nvenc_test_deps], 46 [['elements/pcapparse.c'], false, [libparser_dep]], 47 [['elements/pnm.c']], 48 [['elements/rtponvifparse.c']], 49 [['elements/rtponviftimestamp.c']], 50 [['elements/videoframe-audiolevel.c']], 51 [['elements/viewfinderbin.c']], 52 [['libs/h264parser.c'], false, [gstcodecparsers_dep]], 53 [['libs/h265parser.c'], false, [gstcodecparsers_dep]], 54 [['libs/insertbin.c'], false, [gstinsertbin_dep]], 55 [['libs/isoff.c'], false, [gstisoff_dep]], 56 [['libs/mpegts.c'], false, [gstmpegts_dep]], 57 [['libs/mpegvideoparser.c'], false, [gstcodecparsers_dep]], 58 [['libs/planaraudioadapter.c'], false, [gstbadaudio_dep]], 59 [['libs/player.c'], not enable_gst_player_tests, [gstplayer_dep]], 60 [['libs/vc1parser.c'], false, [gstcodecparsers_dep]], 61 [['libs/vp8parser.c'], false, [gstcodecparsers_dep]], 62] 63 64# FIXME: unistd dependency, unstable or not tested yet on windows 65if host_machine.system() != 'windows' 66 base_tests += [ 67 [['elements/assrender.c'], not ass_dep.found(), [ass_dep]], 68 [['elements/ccconverter.c']], 69 [['elements/cccombiner.c']], 70 [['elements/ccextractor.c']], 71 [['elements/line21.c']], 72 [['elements/curlhttpsink.c'], not curl_dep.found(), [curl_dep]], 73 [['elements/curlhttpsrc.c'], not curl_dep.found(), [curl_dep, gio_dep]], 74 [['elements/curlfilesink.c'], 75 not curl_dep.found() or not cdata.has('HAVE_UNISTD_H'), [curl_dep]], 76 [['elements/curlftpsink.c'], not curl_dep.found(), [curl_dep]], 77 [['elements/curlsmtpsink.c'], not curl_dep.found(), [curl_dep]], 78 [['elements/dash_mpd.c'], not xml2_dep.found(), [xml2_dep]], 79 [['elements/dtls.c'], not libcrypto_dep.found(), [libcrypto_dep]], 80 [['elements/faac.c'], 81 not faac_dep.found() or not cc.has_header_symbol('faac.h', 'faacEncOpen') or not cdata.has('HAVE_UNISTD_H'), 82 [faac_dep]], 83 [['elements/faad.c'], 84 not faad_dep.found() or not have_faad_2_7 or not cdata.has('HAVE_UNISTD_H'), 85 [faad_dep]], 86 [['elements/jifmux.c'], 87 not exif_dep.found() or not cdata.has('HAVE_UNISTD_H'), [exif_dep]], 88 [['elements/jpegparse.c'], not cdata.has('HAVE_UNISTD_H')], 89 [['elements/kate.c'], 90 not kate_dep.found() or not cdata.has('HAVE_UNISTD_H'), [kate_dep]], 91 [['elements/netsim.c']], 92 [['elements/shm.c'], not shm_enabled, shm_deps], 93 [['elements/voaacenc.c'], 94 not voaac_dep.found() or not cdata.has('HAVE_UNISTD_H'), [voaac_dep]], 95 [['elements/webrtcbin.c'], not libnice_dep.found(), [gstwebrtc_dep]], 96 [['elements/x265enc.c'], not x265_dep.found(), [x265_dep]], 97 [['elements/zbar.c'], not zbar_dep.found(), [zbar_dep]], 98 ] 99endif 100 101test_defines = [ 102 '-UG_DISABLE_ASSERT', 103 '-UG_DISABLE_CAST_CHECKS', 104 '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"', 105 '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"', 106 '-DTEST_PATH="' + meson.current_build_dir() + '/media"', 107 '-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data', 108 '-DGST_USE_UNSTABLE_API', 109] 110 111test_deps = [gst_dep, gstapp_dep, gstbase_dep, 112 gstbasecamerabin_dep, gstphotography_dep, 113 gstpbutils_dep, gstcontroller_dep, gstaudio_dep, 114 gstvideo_dep, gstrtp_dep, gsturidownloader_dep, 115 gstcheck_dep, gio_dep, glib_dep, gsttag_dep] 116 117pluginsdirs = [ ] 118 119if gst_dep.type_name() == 'pkgconfig' 120 pbase = dependency('gstreamer-plugins-base-' + api_version) 121 122 pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir')] + [pbase.get_pkgconfig_variable('pluginsdir')] 123endif 124 125foreach t : base_tests 126 fnames = t.get(0) 127 test_name = fnames[0].split('.').get(0).underscorify() 128 skip_test = false 129 extra_deps = [ ] 130 131 if t.length() >= 3 132 extra_deps = t.get(2) 133 endif 134 135 if t.length() >= 2 136 skip_test = t.get(1) 137 endif 138 139 if not skip_test 140 exe = executable(test_name, fnames, 141 include_directories : [configinc], 142 c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines, 143 cpp_args : gst_plugins_bad_args, 144 dependencies : [libm] + test_deps + extra_deps, 145 ) 146 147 env = environment() 148 env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '') 149 env.set('CK_DEFAULT_TIMEOUT', '20') 150 env.set('GST_STATE_IGNORE_ELEMENTS', '') 151 env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs) 152 env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name))) 153 env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base', 154 'gst-plugins-good', 'gst-plugins-ugly','gst-libav', 155 'gst-plugins-bad@' + meson.build_root()) 156 test(test_name, exe, env: env, timeout: 3 * 60) 157 endif 158endforeach 159 160# orc tests 161orc_tests = [ 162 ['orc_bayer', files('../../gst/bayer/gstbayerorc.orc')], 163] 164 165orc_test_dep = dependency('', required : false) 166if have_orcc 167 # FIXME: there should really just be a separate orc-test-0.4.pc file for this 168 if orc_dep.type_name() == 'pkgconfig' 169 orc_test_dep = cc.find_library('orc-test-0.4', required : false) 170 else 171 orc_test_dep = dependency('', fallback: ['orc', 'orc_test_dep'], required: false) 172 endif 173endif 174 175if have_orcc and orc_test_dep.found() 176 foreach t : orc_tests 177 tname = t[0] 178 torcfile = t[1] 179 tcfilename = '@0@.c'.format(tname) 180 test_c = custom_target(tcfilename, 181 output: tcfilename, 182 input: torcfile, 183 command: [orcc, '--include', 'stdint.h', '--test', '-o', '@OUTPUT@', '@INPUT@']) 184 test_exe = executable(tname, test_c, dependencies: [orc_dep, orc_test_dep]) 185 test(tname, test_exe) 186 endforeach 187endif 188 189if enable_gst_player_tests 190 subdir ('media') 191endif 192