2018-05-05 13:55:20 +00:00
|
|
|
have_registry = true # FIXME get_option('registry')
|
2016-08-12 15:26:31 +00:00
|
|
|
|
|
|
|
# name, condition when to skip the test and extra dependencies
|
|
|
|
base_tests = [
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'gst/typefindfunctions.c', not have_registry ],
|
|
|
|
[ 'libs/audio.c' ],
|
|
|
|
[ 'libs/audiocdsrc.c' ],
|
|
|
|
[ 'libs/audiodecoder.c' ],
|
|
|
|
[ 'libs/audioencoder.c' ],
|
2020-01-22 13:30:11 +00:00
|
|
|
[ 'libs/audiosink.c' ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'libs/baseaudiovisualizer.c' ],
|
|
|
|
[ 'libs/discoverer.c' ],
|
|
|
|
[ 'libs/fft.c' ],
|
2022-03-29 15:51:13 +00:00
|
|
|
[ 'libs/libsabi.c', false, [ gstgl_dep, gstglx11_dep, gstglwayland_dep, gstglegl_dep ] ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'libs/mikey.c' ],
|
|
|
|
[ 'libs/navigation.c' ],
|
|
|
|
[ 'libs/pbutils.c' ],
|
|
|
|
[ 'libs/profile.c' ],
|
2018-12-30 09:49:52 +00:00
|
|
|
[ 'libs/rtp.c' ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'libs/rtpbasedepayload.c' ],
|
|
|
|
[ 'libs/rtpbasepayload.c' ],
|
2020-07-10 05:14:09 +00:00
|
|
|
[ 'libs/rtphdrext.c' ],
|
2018-10-16 14:56:26 +00:00
|
|
|
[ 'libs/rtpmeta.c' ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'libs/rtsp.c' ],
|
|
|
|
[ 'libs/sdp.c' ],
|
|
|
|
[ 'libs/tag.c' ],
|
2018-12-30 09:49:52 +00:00
|
|
|
[ 'libs/video.c' ],
|
2018-11-01 17:19:51 +00:00
|
|
|
[ 'libs/videoanc.c' ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'libs/videoencoder.c' ],
|
2018-04-05 14:41:57 +00:00
|
|
|
[ 'libs/videodecoder.c' ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'libs/videotimecode.c' ],
|
|
|
|
[ 'libs/xmpwriter.c' ],
|
2022-06-25 18:50:10 +00:00
|
|
|
[ 'elements/adder.c', get_option('adder').disabled()],
|
|
|
|
[ 'elements/appsink.c', get_option('app').disabled()],
|
|
|
|
[ 'elements/appsrc.c', get_option('app').disabled()],
|
|
|
|
[ 'elements/audioconvert.c', get_option('audioconvert').disabled()],
|
|
|
|
[ 'elements/audiointerleave.c', get_option('audiomixer').disabled()],
|
|
|
|
[ 'elements/audiomixer.c', get_option('audiomixer').disabled(), [ gst_controller_dep ] ],
|
|
|
|
[ 'elements/audiorate.c', get_option('audiorate').disabled()],
|
|
|
|
[ 'elements/audiotestsrc.c', get_option('audiotestsrc').disabled()],
|
|
|
|
[ 'elements/audioresample.c', get_option('audioresample').disabled()],
|
|
|
|
[ 'elements/compositor.c', get_option('compositor').disabled()],
|
|
|
|
[ 'elements/decodebin.c', get_option('playback').disabled()],
|
|
|
|
[ 'elements/overlaycomposition.c', get_option('overlaycomposition').disabled()],
|
|
|
|
[ 'elements/playbin.c', get_option('playback').disabled()],
|
|
|
|
[ 'elements/playsink.c', get_option('playback').disabled()],
|
|
|
|
[ 'elements/streamsynchronizer.c', get_option('playback').disabled()],
|
|
|
|
[ 'elements/subparse.c', get_option('subparse').disabled()],
|
|
|
|
[ 'elements/urisourcebin.c', get_option('playback').disabled()],
|
|
|
|
[ 'elements/videoconvert.c', get_option('videoconvert').disabled()],
|
|
|
|
[ 'elements/videorate.c', get_option('videorate').disabled()],
|
|
|
|
[ 'elements/videoscale.c', get_option('videoscale').disabled()],
|
|
|
|
[ 'elements/videotestsrc.c', get_option('videotestsrc').disabled()],
|
|
|
|
[ 'elements/volume.c', get_option('volume').disabled(), [ gst_controller_dep ] ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'generic/clock-selection.c' ],
|
2017-12-11 11:59:57 +00:00
|
|
|
[ 'generic/states.c', false, [ gmodule_dep ] ],
|
2016-10-04 20:44:51 +00:00
|
|
|
[ 'pipelines/simple-launch-lines.c' ],
|
|
|
|
[ 'pipelines/basetime.c' ],
|
|
|
|
[ 'pipelines/capsfilter-renegotiation.c' ],
|
|
|
|
[ 'pipelines/gio.c' ],
|
|
|
|
[ 'pipelines/streamsynchronizer.c' ],
|
2016-08-12 15:26:31 +00:00
|
|
|
]
|
|
|
|
|
2018-12-07 12:02:45 +00:00
|
|
|
# FIXME: unistd dependency, unstable or not tested yet on windows
|
|
|
|
if host_machine.system() != 'windows'
|
|
|
|
base_tests += [
|
|
|
|
[ 'libs/allocators.c', host_machine.system() != 'linux' ],
|
|
|
|
[ 'libs/rtspconnection.c' ],
|
|
|
|
[ 'elements/libvisual.c', not is_variable('libvisual_dep') or not libvisual_dep.found() ],
|
|
|
|
[ 'elements/encodebin.c', not theoraenc_dep.found() or not vorbisenc_dep.found() ],
|
|
|
|
[ 'elements/multifdsink.c', not core_conf.has('HAVE_SYS_SOCKET_H') or not core_conf.has('HAVE_UNISTD_H') ],
|
|
|
|
# FIXME: multisocketsink test on windows/msvc
|
|
|
|
[ 'elements/multisocketsink.c', not core_conf.has('HAVE_SYS_SOCKET_H') or not core_conf.has('HAVE_UNISTD_H') ],
|
|
|
|
[ 'elements/playbin-complex.c', not ogg_dep.found() ],
|
|
|
|
[ 'elements/textoverlay.c', not pango_dep.found() ],
|
|
|
|
[ 'elements/vorbisdec.c', not vorbis_dep.found(), [ vorbis_dep, vorbisenc_dep ] ],
|
|
|
|
[ 'elements/vorbistag.c', not vorbisenc_dep.found(), [ vorbis_dep, vorbisenc_dep ] ],
|
|
|
|
[ 'pipelines/oggmux.c', not ogg_dep.found(), [ ogg_dep, ] ],
|
|
|
|
# FIXME: tcp test on windows/msvc
|
|
|
|
[ 'pipelines/tcp.c', not core_conf.has('HAVE_SYS_SOCKET_H') or not core_conf.has('HAVE_UNISTD_H'), [giounix_dep] ],
|
|
|
|
[ 'pipelines/theoraenc.c', not theoraenc_dep.found(), [ theoraenc_dep ] ],
|
|
|
|
[ 'pipelines/vorbisenc.c', not vorbisenc_dep.found() ],
|
|
|
|
[ 'pipelines/vorbisdec.c', not vorbisenc_dep.found() ],
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
|
|
|
# FIXME: Unstable on Windows
|
|
|
|
if build_gstgl and host_machine.system() != 'windows'
|
2017-12-21 18:24:20 +00:00
|
|
|
base_tests += [
|
2020-09-08 05:53:27 +00:00
|
|
|
[ 'libs/gstglapi.c', not build_gstgl, [gstgl_dep]],
|
2020-07-23 09:48:55 +00:00
|
|
|
[ 'libs/gstglcolorconvert.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglcontext.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglfeature.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglformat.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
2022-03-29 15:51:13 +00:00
|
|
|
[ 'libs/gstglheaders.c', not build_gstgl, [gstgl_dep, gstglx11_dep, gstglwayland_dep, gstglegl_dep]],
|
|
|
|
[ 'libs/gstglmatrix.c', not build_gstgl, [gstgl_dep]],
|
2020-07-23 09:48:55 +00:00
|
|
|
[ 'libs/gstglmemory.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglquery.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglshader.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglsl.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglslstage.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'libs/gstglupload.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'elements/glimagesink.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
2018-02-09 06:15:30 +00:00
|
|
|
[ 'elements/glbin.c', not build_gstgl ],
|
2017-12-22 21:28:20 +00:00
|
|
|
[ 'pipelines/gl-launch-lines.c', not build_gstgl ],
|
2020-07-23 09:48:55 +00:00
|
|
|
[ 'elements/glfilter.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'elements/glstereo.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
|
|
|
[ 'elements/glmixer.c', not build_gstgl, [gstgl_dep, gstglproto_dep]],
|
2017-12-21 18:24:20 +00:00
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2017-05-21 08:37:14 +00:00
|
|
|
# Make sure our headers are C++ clean
|
2017-05-21 09:49:20 +00:00
|
|
|
if have_cxx
|
2017-05-21 08:37:14 +00:00
|
|
|
base_tests += [
|
|
|
|
[ 'libs/gstlibscpp.cc', false, [ ] ],
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2016-08-12 15:26:31 +00:00
|
|
|
test_defines = [
|
|
|
|
'-UG_DISABLE_ASSERT',
|
|
|
|
'-UG_DISABLE_CAST_CHECKS',
|
|
|
|
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"',
|
2016-10-04 20:44:51 +00:00
|
|
|
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
|
|
|
|
'-DGST_TEST_FILE="' + meson.current_source_dir() + '/../files/partialframe.mjpeg"', # for libs/discoverer
|
2016-08-12 15:26:31 +00:00
|
|
|
'-DGST_USE_UNSTABLE_API',
|
|
|
|
]
|
|
|
|
|
2019-12-08 01:17:31 +00:00
|
|
|
valgrind_dep = dependency('valgrind', required: false)
|
|
|
|
if valgrind_dep.found()
|
|
|
|
test_defines += ['-DHAVE_VALGRIND']
|
|
|
|
endif
|
|
|
|
|
2020-07-16 08:10:45 +00:00
|
|
|
if build_gstgl
|
|
|
|
test_defines += ['-DTEST_GST_GL_ABI_CHECK']
|
|
|
|
endif
|
|
|
|
|
2016-08-12 15:26:31 +00:00
|
|
|
test_deps = [gst_dep, gst_base_dep, gst_net_dep, gst_check_dep, audio_dep,
|
|
|
|
video_dep, pbutils_dep, rtp_dep, rtsp_dep, tag_dep, allocators_dep, app_dep,
|
2019-12-08 01:17:31 +00:00
|
|
|
fft_dep, riff_dep, sdp_dep, gio_dep, valgrind_dep] + glib_deps
|
2016-08-12 15:26:31 +00:00
|
|
|
|
|
|
|
foreach t : base_tests
|
2016-10-04 20:44:51 +00:00
|
|
|
fname = t.get(0)
|
2017-06-07 15:41:05 +00:00
|
|
|
test_name = fname.split('.').get(0).underscorify()
|
2016-10-04 20:44:51 +00:00
|
|
|
skip_test = false
|
2016-08-12 15:26:31 +00:00
|
|
|
extra_deps = [ ]
|
2016-10-04 20:44:51 +00:00
|
|
|
|
|
|
|
if t.length() >= 3
|
2016-08-12 15:26:31 +00:00
|
|
|
extra_deps = t.get(2)
|
2016-10-04 20:44:51 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if t.length() >= 2
|
2016-08-12 15:26:31 +00:00
|
|
|
skip_test = t.get(1)
|
|
|
|
endif
|
2016-10-04 20:44:51 +00:00
|
|
|
|
2016-08-12 15:26:31 +00:00
|
|
|
if not skip_test
|
2016-10-04 20:44:51 +00:00
|
|
|
exe = executable(test_name, fname,
|
2016-08-12 15:26:31 +00:00
|
|
|
include_directories : [configinc],
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
|
2016-10-04 20:44:51 +00:00
|
|
|
cpp_args : gst_plugins_base_args,
|
2016-08-12 15:26:31 +00:00
|
|
|
dependencies : [libm] + test_deps + extra_deps,
|
|
|
|
)
|
2016-10-04 20:44:51 +00:00
|
|
|
|
|
|
|
env = environment()
|
2021-10-18 14:47:00 +00:00
|
|
|
env.set('GST_PLUGIN_PATH_1_0', meson.global_build_root(), pluginsdirs)
|
2016-10-04 20:44:51 +00:00
|
|
|
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
|
|
|
|
env.set('GST_STATE_IGNORE_ELEMENTS', 'cdio cdparanoiasrc libvisual_ alsasrc alsasink')
|
|
|
|
env.set('CK_DEFAULT_TIMEOUT', '20')
|
2018-12-07 11:30:23 +00:00
|
|
|
env.set('GST_TAG_LICENSE_TRANSLATIONS_DICT', join_paths(gst_tag_dir, 'license-translations.dict'))
|
2016-10-04 20:44:51 +00:00
|
|
|
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer',
|
2021-10-18 14:47:00 +00:00
|
|
|
'gst-plugins-base@' + meson.project_build_root())
|
2018-12-07 11:30:23 +00:00
|
|
|
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
|
2020-02-27 00:05:52 +00:00
|
|
|
env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
|
2016-10-04 20:44:51 +00:00
|
|
|
test(test_name, exe, env: env, timeout: 3 * 60)
|
2016-08-12 15:26:31 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2016-09-10 09:05:28 +00:00
|
|
|
# videoscale tests (split in groups)
|
|
|
|
foreach group : [1, 2, 3, 4, 5, 6]
|
2017-06-07 15:41:05 +00:00
|
|
|
vscale_test_name = 'elements-videoscale-@0@'.format(group)
|
2018-12-07 11:30:23 +00:00
|
|
|
exe = executable(vscale_test_name, join_paths('elements', 'videoscale.c'),
|
2016-09-10 09:05:28 +00:00
|
|
|
include_directories : [configinc],
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1', '-DVSCALE_TEST_GROUP=@0@'.format(group) ] + test_defines,
|
|
|
|
dependencies : [libm] + test_deps + extra_deps)
|
|
|
|
|
2016-10-04 20:44:51 +00:00
|
|
|
# TODO Use env.copy when it is in meson
|
|
|
|
env = environment()
|
2021-10-18 14:47:00 +00:00
|
|
|
env.set('GST_PLUGIN_PATH_1_0', meson.global_build_root(), pluginsdirs)
|
2016-10-04 20:44:51 +00:00
|
|
|
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
|
|
|
|
env.set('GST_STATE_IGNORE_ELEMENTS', 'cdio cdparanoiasrc libvisual_ alsasrc alsasink')
|
|
|
|
env.set('CK_DEFAULT_TIMEOUT', '20')
|
2018-12-07 11:30:23 +00:00
|
|
|
env.set('GST_TAG_LICENSE_TRANSLATIONS_DICT', join_paths(gst_tag_dir, 'license-translations.dict'))
|
2016-10-04 20:44:51 +00:00
|
|
|
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer',
|
2021-10-18 14:47:00 +00:00
|
|
|
'gst-plugins-base@' + meson.project_build_root())
|
2021-05-14 22:16:32 +00:00
|
|
|
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(vscale_test_name)))
|
2020-02-27 00:05:52 +00:00
|
|
|
env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
|
2016-10-04 20:44:51 +00:00
|
|
|
|
|
|
|
test(vscale_test_name, exe, env: env, timeout: 3 * 60)
|
|
|
|
endforeach
|
2019-01-16 00:37:48 +00:00
|
|
|
|
|
|
|
# orc tests
|
|
|
|
orc_tests = [
|
|
|
|
['orc_audio', files('../../gst-libs/gst/audio/gstaudiopack.orc')],
|
|
|
|
['orc_video', files('../../gst-libs/gst/video/video-orc.orc')],
|
|
|
|
['orc_adder', files('../../gst/adder/gstadderorc.orc')],
|
|
|
|
['orc_audiomixer', files('../../gst/audiomixer/gstaudiomixerorc.orc')],
|
|
|
|
['orc_compositor', files('../../gst/compositor/compositororc.orc')],
|
|
|
|
['orc_volume', files('../../gst/volume/gstvolumeorc.orc')],
|
|
|
|
['orc_videotestsrc', files('../../gst/videotestsrc/gstvideotestsrcorc.orc')],
|
|
|
|
]
|
|
|
|
|
2019-01-29 01:38:15 +00:00
|
|
|
orc_test_dep = dependency('', required : false)
|
2019-01-16 00:37:48 +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-29 01:38:15 +00:00
|
|
|
orc_test_dep = cc.find_library('orc-test-0.4', required : false)
|
|
|
|
endif
|
|
|
|
if not orc_test_dep.found()
|
2019-01-31 09:52:21 +00:00
|
|
|
orc_test_dep = dependency('', fallback: ['orc', 'orc_test_dep'], required: false)
|
2019-01-16 00:37:48 +00:00
|
|
|
endif
|
2019-01-29 01:38:15 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if have_orcc and orc_test_dep.found()
|
2019-01-16 00:37:48 +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
|