2018-05-05 14:00:42 +00:00
|
|
|
have_registry = true # FIXME get_option('registry')
|
2017-05-18 20:02:38 +00:00
|
|
|
|
2017-08-10 08:07:17 +00:00
|
|
|
libparser = static_library('parser',
|
|
|
|
'elements/parser.c',
|
2017-05-18 20:02:38 +00:00
|
|
|
install : false,
|
|
|
|
dependencies : [gst_dep, gstcheck_dep],
|
|
|
|
)
|
|
|
|
|
|
|
|
libparser_dep = declare_dependency(link_with: libparser,
|
|
|
|
sources: ['elements/parser.h'])
|
|
|
|
|
2018-07-27 13:29:23 +00:00
|
|
|
# FIXME: automagic
|
2017-05-18 20:02:38 +00:00
|
|
|
exif_dep = dependency('libexif', version : '>= 0.6.16', required : false)
|
|
|
|
|
2018-05-05 14:00:42 +00:00
|
|
|
enable_gst_player_tests = get_option('gst_player_tests')
|
2017-10-16 17:51:36 +00:00
|
|
|
|
2017-05-18 20:02:38 +00:00
|
|
|
# name, condition when to skip the test and extra dependencies
|
|
|
|
base_tests = [
|
|
|
|
[['elements/aiffparse.c']],
|
2018-12-30 13:31:39 +00:00
|
|
|
[['elements/asfmux.c']],
|
2017-05-18 20:02:38 +00:00
|
|
|
[['elements/autoconvert.c']],
|
|
|
|
[['elements/autovideoconvert.c']],
|
2018-08-16 14:47:55 +00:00
|
|
|
[['elements/avwait.c']],
|
2018-12-30 13:31:39 +00:00
|
|
|
[['elements/camerabin.c']],
|
|
|
|
[['elements/gdpdepay.c']],
|
|
|
|
[['elements/gdppay.c']],
|
2018-12-07 14:22:08 +00:00
|
|
|
[['elements/h263parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
|
|
|
|
[['elements/h264parse.c'], false, [libparser_dep, gstcodecparsers_dep]],
|
2017-05-18 20:02:38 +00:00
|
|
|
[['elements/id3mux.c']],
|
2018-12-07 14:22:08 +00:00
|
|
|
[['elements/mpegtsmux.c'], false, [gstmpegts_dep]],
|
|
|
|
[['elements/mpeg4videoparse.c'], false, [libparser_dep, gstcodecparsers_dep]],
|
|
|
|
[['elements/mpegvideoparse.c'], false, [libparser_dep, gstcodecparsers_dep]],
|
2018-12-30 13:31:39 +00:00
|
|
|
[['elements/msdkh264enc.c'], not have_msdk, [msdk_dep]],
|
2017-05-18 20:02:38 +00:00
|
|
|
[['elements/mxfdemux.c']],
|
|
|
|
[['elements/mxfmux.c']],
|
2017-08-10 08:07:17 +00:00
|
|
|
[['elements/pcapparse.c'], false, [libparser_dep]],
|
2017-05-18 20:02:38 +00:00
|
|
|
[['elements/pnm.c']],
|
|
|
|
[['elements/rtponvifparse.c']],
|
|
|
|
[['elements/rtponviftimestamp.c']],
|
|
|
|
[['elements/videoframe-audiolevel.c']],
|
|
|
|
[['elements/viewfinderbin.c']],
|
2017-10-16 17:51:36 +00:00
|
|
|
[['libs/h264parser.c'], false, [gstcodecparsers_dep]],
|
2018-03-01 10:08:44 +00:00
|
|
|
[['libs/h265parser.c'], false, [gstcodecparsers_dep]],
|
2017-10-16 17:51:36 +00:00
|
|
|
[['libs/insertbin.c'], false, [gstinsertbin_dep]],
|
2018-12-18 13:07:48 +00:00
|
|
|
[['libs/isoff.c'], false, [gstisoff_dep]],
|
2018-12-30 13:31:39 +00:00
|
|
|
[['libs/mpegts.c'], false, [gstmpegts_dep]],
|
2017-10-16 17:51:36 +00:00
|
|
|
[['libs/mpegvideoparser.c'], false, [gstcodecparsers_dep]],
|
2018-02-16 13:55:45 +00:00
|
|
|
[['libs/planaraudioadapter.c'], false, [gstbadaudio_dep]],
|
2017-10-16 17:51:36 +00:00
|
|
|
[['libs/player.c'], not enable_gst_player_tests, [gstplayer_dep]],
|
|
|
|
[['libs/vc1parser.c'], false, [gstcodecparsers_dep]],
|
|
|
|
[['libs/vp8parser.c'], false, [gstcodecparsers_dep]],
|
2017-05-18 20:02:38 +00:00
|
|
|
]
|
|
|
|
|
2018-12-07 14:22:08 +00:00
|
|
|
# FIXME: unistd dependency, unstable or not tested yet on windows
|
|
|
|
if host_machine.system() != 'windows'
|
|
|
|
base_tests += [
|
|
|
|
[['elements/assrender.c'], not ass_dep.found(), [ass_dep]],
|
2018-12-13 12:27:25 +00:00
|
|
|
[['elements/ccconverter.c']],
|
2018-12-07 14:22:08 +00:00
|
|
|
[['elements/cccombiner.c']],
|
|
|
|
[['elements/ccextractor.c']],
|
|
|
|
[['elements/curlhttpsink.c'], not curl_dep.found(), [curl_dep]],
|
2019-02-05 16:23:01 +00:00
|
|
|
[['elements/curlhttpsrc.c'], not curl_dep.found(), [curl_dep, gio_dep]],
|
2018-12-07 14:22:08 +00:00
|
|
|
[['elements/curlfilesink.c'],
|
|
|
|
not curl_dep.found() or not cdata.has('HAVE_UNISTD_H'), [curl_dep]],
|
|
|
|
[['elements/curlftpsink.c'], not curl_dep.found(), [curl_dep]],
|
|
|
|
[['elements/curlsmtpsink.c'], not curl_dep.found(), [curl_dep]],
|
|
|
|
[['elements/dash_mpd.c'], not xml2_dep.found(), [xml2_dep]],
|
|
|
|
[['elements/dtls.c'], not libcrypto_dep.found(), [libcrypto_dep]],
|
|
|
|
[['elements/faac.c'],
|
|
|
|
not faac_dep.found() or not cc.has_header_symbol('faac.h', 'faacEncOpen') or not cdata.has('HAVE_UNISTD_H'),
|
|
|
|
[faac_dep]],
|
|
|
|
[['elements/faad.c'],
|
|
|
|
not faad_dep.found() or not have_faad_2_7 or not cdata.has('HAVE_UNISTD_H'),
|
|
|
|
[faad_dep]],
|
|
|
|
[['elements/jifmux.c'],
|
|
|
|
not exif_dep.found() or not cdata.has('HAVE_UNISTD_H'), [exif_dep]],
|
|
|
|
[['elements/jpegparse.c'], not cdata.has('HAVE_UNISTD_H')],
|
|
|
|
[['elements/kate.c'],
|
|
|
|
not kate_dep.found() or not cdata.has('HAVE_UNISTD_H'), [kate_dep]],
|
|
|
|
[['elements/netsim.c']],
|
|
|
|
[['elements/shm.c'], not shm_enabled, shm_deps],
|
|
|
|
[['elements/voaacenc.c'],
|
|
|
|
not voaac_dep.found() or not cdata.has('HAVE_UNISTD_H'), [voaac_dep]],
|
|
|
|
[['elements/webrtcbin.c'], not libnice_dep.found(), [gstwebrtc_dep]],
|
|
|
|
[['elements/x265enc.c'], not x265_dep.found(), [x265_dep]],
|
|
|
|
[['elements/zbar.c'], not zbar_dep.found(), [zbar_dep]],
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2017-05-18 20:02:38 +00:00
|
|
|
test_defines = [
|
|
|
|
'-UG_DISABLE_ASSERT',
|
|
|
|
'-UG_DISABLE_CAST_CHECKS',
|
|
|
|
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
|
|
|
|
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
|
2017-10-16 17:51:36 +00:00
|
|
|
'-DTEST_PATH="' + meson.current_build_dir() + '/media"',
|
2017-05-18 20:02:38 +00:00
|
|
|
'-DDASH_MPD_DATADIR=' + meson.current_source_dir() + '/elements/dash_mpd_data',
|
|
|
|
'-DGST_USE_UNSTABLE_API',
|
|
|
|
]
|
|
|
|
|
2017-06-07 20:58:23 +00:00
|
|
|
test_deps = [gst_dep, gstapp_dep, gstbase_dep,
|
|
|
|
gstbasecamerabin_dep, gstphotography_dep,
|
|
|
|
gstpbutils_dep, gstcontroller_dep, gstaudio_dep,
|
|
|
|
gstvideo_dep, gstrtp_dep, gsturidownloader_dep,
|
2017-08-10 08:07:17 +00:00
|
|
|
gstcheck_dep, gio_dep, glib_dep, gsttag_dep]
|
2017-05-18 20:02:38 +00:00
|
|
|
|
|
|
|
pluginsdirs = [ ]
|
|
|
|
|
|
|
|
if gst_dep.type_name() == 'pkgconfig'
|
2017-06-07 20:58:23 +00:00
|
|
|
pbase = dependency('gstreamer-plugins-base-' + api_version)
|
|
|
|
|
|
|
|
pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir')] + [pbase.get_pkgconfig_variable('pluginsdir')]
|
2017-05-18 20:02:38 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
foreach t : base_tests
|
|
|
|
fnames = t.get(0)
|
2017-06-20 17:44:47 +00:00
|
|
|
test_name = fnames[0].split('.').get(0).underscorify()
|
2017-05-18 20:02:38 +00:00
|
|
|
skip_test = false
|
|
|
|
extra_deps = [ ]
|
|
|
|
|
|
|
|
if t.length() >= 3
|
|
|
|
extra_deps = t.get(2)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if t.length() >= 2
|
|
|
|
skip_test = t.get(1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not skip_test
|
|
|
|
exe = executable(test_name, fnames,
|
|
|
|
include_directories : [configinc],
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
|
|
|
|
cpp_args : gst_plugins_bad_args,
|
|
|
|
dependencies : [libm] + test_deps + extra_deps,
|
|
|
|
)
|
|
|
|
|
|
|
|
env = environment()
|
|
|
|
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
|
|
|
|
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
|
|
|
|
env.set('CK_DEFAULT_TIMEOUT', '20')
|
|
|
|
env.set('GST_STATE_IGNORE_ELEMENTS', '')
|
2017-06-07 20:58:23 +00:00
|
|
|
env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
|
2018-12-18 12:16:43 +00:00
|
|
|
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
|
2018-12-07 14:22:08 +00:00
|
|
|
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
|
|
|
|
'gst-plugins-good', 'gst-plugins-ugly','gst-libav',
|
|
|
|
'gst-plugins-bad@' + meson.build_root())
|
2017-05-18 20:02:38 +00:00
|
|
|
test(test_name, exe, env: env, timeout: 3 * 60)
|
|
|
|
endif
|
|
|
|
endforeach
|
2017-10-16 17:51:36 +00:00
|
|
|
|
2019-01-16 01:03:40 +00:00
|
|
|
# orc tests
|
|
|
|
orc_tests = [
|
|
|
|
['orc_bayer', files('../../gst/bayer/gstbayerorc.orc')],
|
|
|
|
]
|
|
|
|
|
2019-01-30 10:54:33 +00:00
|
|
|
orc_test_dep = dependency('', required : false)
|
2019-01-16 01:03:40 +00:00
|
|
|
if have_orcc
|
|
|
|
# FIXME: there should really just be a separate orc-test-0.4.pc file for this
|
|
|
|
if orc_dep.type_name() == 'pkgconfig'
|
2019-01-30 10:54:33 +00:00
|
|
|
orc_test_dep = cc.find_library('orc-test-0.4', required : false)
|
2019-01-31 09:54:06 +00:00
|
|
|
else
|
|
|
|
orc_test_dep = dependency('', fallback: ['orc', 'orc_test_dep'], required: false)
|
2019-01-16 01:03:40 +00:00
|
|
|
endif
|
2019-01-30 10:54:33 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if have_orcc and orc_test_dep.found()
|
2019-01-16 01:03:40 +00:00
|
|
|
foreach t : orc_tests
|
|
|
|
tname = t[0]
|
|
|
|
torcfile = t[1]
|
|
|
|
tcfilename = '@0@.c'.format(tname)
|
|
|
|
test_c = custom_target(tcfilename,
|
|
|
|
output: tcfilename,
|
|
|
|
input: torcfile,
|
|
|
|
command: [orcc, '--include', 'stdint.h', '--test', '-o', '@OUTPUT@', '@INPUT@'])
|
|
|
|
test_exe = executable(tname, test_c, dependencies: [orc_dep, orc_test_dep])
|
|
|
|
test(tname, test_exe)
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
2017-10-16 17:51:36 +00:00
|
|
|
if enable_gst_player_tests
|
|
|
|
subdir ('media')
|
|
|
|
endif
|