mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
meson: Make use of new environment object and set plugin path to builddir
Workaround source_root being the root directory of all projects in the subproject case. Remove now unneeded getpluginsdir and define c++ tests in the same loop. Bump meson requirement to 0.35
This commit is contained in:
parent
86d18fa9ff
commit
558172d418
4 changed files with 130 additions and 135 deletions
|
@ -52,3 +52,5 @@ executable('mklicensestables', 'mklicensestables.c',
|
||||||
dependencies : [tag_dep, gst_base_dep],
|
dependencies : [tag_dep, gst_base_dep],
|
||||||
install : false,
|
install : false,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
gst_tag_dir = meson.current_source_dir()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
project('gst-plugins-base', 'c', 'cpp',
|
project('gst-plugins-base', 'c', 'cpp',
|
||||||
version : '1.9.90',
|
version : '1.9.90',
|
||||||
meson_version : '>= 0.33.0',
|
meson_version : '>= 0.35.0',
|
||||||
default_options : [ 'warning_level=1',
|
default_options : [ 'warning_level=1',
|
||||||
'c_std=gnu99',
|
'c_std=gnu99',
|
||||||
'buildtype=debugoptimized' ])
|
'buildtype=debugoptimized' ])
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
builddir = os.environ['MESON_BUILD_ROOT']
|
|
||||||
|
|
||||||
res = ''
|
|
||||||
args = sys.argv[1:]
|
|
||||||
for i in range(0, len(args), 2):
|
|
||||||
project = args[i]
|
|
||||||
pkg_name = args[i + 1]
|
|
||||||
path = os.path.join(builddir, 'subprojects', project)
|
|
||||||
if os.path.exists(path):
|
|
||||||
res += ':' + path
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
res += ':' + subprocess.check_output([
|
|
||||||
'pkg-config', '--variable=pluginsdir',
|
|
||||||
pkg_name]).decode().replace("\n", "")
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
# Probably means there is no .pc file for the module
|
|
||||||
# and it should hopefully no be too bad.
|
|
||||||
pass
|
|
||||||
|
|
||||||
print(res.strip(":"))
|
|
|
@ -2,69 +2,69 @@ have_registry = true # FIXME not get_option('disable_registry')
|
||||||
|
|
||||||
# name, condition when to skip the test and extra dependencies
|
# name, condition when to skip the test and extra dependencies
|
||||||
base_tests = [
|
base_tests = [
|
||||||
[ 'gst/typefindfunctions', not have_registry ],
|
[ 'gst/typefindfunctions.c', not have_registry ],
|
||||||
[ 'libs/allocators' ],
|
[ 'libs/allocators.c' ],
|
||||||
[ 'libs/audio' ],
|
[ 'libs/audio.c' ],
|
||||||
[ 'libs/audiocdsrc' ],
|
[ 'libs/audiocdsrc.c' ],
|
||||||
[ 'libs/audiodecoder' ],
|
[ 'libs/audiodecoder.c' ],
|
||||||
[ 'libs/audioencoder' ],
|
[ 'libs/audioencoder.c' ],
|
||||||
[ 'libs/baseaudiovisualizer' ],
|
[ 'libs/baseaudiovisualizer.c' ],
|
||||||
[ 'libs/discoverer' ],
|
[ 'libs/discoverer.c' ],
|
||||||
[ 'libs/fft' ],
|
[ 'libs/fft.c' ],
|
||||||
[ 'libs/libsabi' ],
|
[ 'libs/libsabi.c' ],
|
||||||
[ 'libs/mikey' ],
|
[ 'libs/mikey.c' ],
|
||||||
[ 'libs/navigation' ],
|
[ 'libs/navigation.c' ],
|
||||||
[ 'libs/pbutils' ],
|
[ 'libs/pbutils.c' ],
|
||||||
[ 'libs/profile' ],
|
[ 'libs/profile.c' ],
|
||||||
[ 'libs/rtpbasedepayload' ],
|
[ 'libs/rtpbasedepayload.c' ],
|
||||||
[ 'libs/rtpbasepayload' ],
|
[ 'libs/rtpbasepayload.c' ],
|
||||||
[ 'libs/rtp' ],
|
[ 'libs/rtp.c' ],
|
||||||
[ 'libs/rtsp' ],
|
[ 'libs/rtsp.c' ],
|
||||||
[ 'libs/rtspconnection' ],
|
[ 'libs/rtspconnection.c' ],
|
||||||
[ 'libs/sdp' ],
|
[ 'libs/sdp.c' ],
|
||||||
[ 'libs/tag' ],
|
[ 'libs/tag.c' ],
|
||||||
# [ 'libs/video' ], # FIXME: times out, perhaps split or spawn conversions into benchmark tool and/or multiple threads
|
# [ 'libs/video' ], # FIXME: times out, perhaps split or spawn conversions into benchmark tool and/or multiple threads
|
||||||
[ 'libs/videodecoder' ],
|
[ 'libs/videoencoder.c' ],
|
||||||
[ 'libs/videoencoder' ],
|
[ 'libs/videotimecode.c' ],
|
||||||
[ 'libs/videotimecode' ],
|
[ 'libs/xmpwriter.c' ],
|
||||||
[ 'libs/xmpwriter' ],
|
[ 'elements/adder.c' ],
|
||||||
[ 'elements/adder' ],
|
[ 'elements/appsink.c' ],
|
||||||
[ 'elements/appsink' ],
|
[ 'elements/appsrc.c' ],
|
||||||
[ 'elements/appsrc' ],
|
[ 'elements/audioconvert.c' ],
|
||||||
[ 'elements/audioconvert' ],
|
[ 'elements/audiorate.c' ],
|
||||||
[ 'elements/audiorate' ],
|
[ 'elements/audiotestsrc.c' ],
|
||||||
[ 'elements/audiotestsrc' ],
|
[ 'elements/audioresample.c' ],
|
||||||
[ 'elements/audioresample' ],
|
[ 'elements/libvisual.c', not libvisual_dep.found() ],
|
||||||
[ 'elements/libvisual', not libvisual_dep.found() ],
|
[ 'elements/decodebin.c' ],
|
||||||
[ 'elements/decodebin' ],
|
[ 'elements/encodebin.c', not theoraenc_dep.found() or not vorbisenc_dep.found() ],
|
||||||
[ 'elements/encodebin', not theoraenc_dep.found() or not vorbisenc_dep.found() ],
|
[ 'elements/multifdsink.c' ],
|
||||||
[ 'elements/multifdsink' ],
|
[ 'elements/multisocketsink.c' ],
|
||||||
[ 'elements/multisocketsink' ],
|
[ 'elements/playbin.c' ],
|
||||||
[ 'elements/playbin' ],
|
[ 'elements/playbin-complex.c', not ogg_dep.found() ],
|
||||||
[ 'elements/playbin-complex', not ogg_dep.found() ],
|
[ 'elements/playsink.c' ],
|
||||||
[ 'elements/playsink' ],
|
[ 'elements/streamsynchronizer.c' ],
|
||||||
[ 'elements/streamsynchronizer' ],
|
[ 'elements/subparse.c' ],
|
||||||
[ 'elements/subparse' ],
|
[ 'elements/textoverlay.c', not pango_dep.found() ],
|
||||||
[ 'elements/textoverlay', not pango_dep.found() ],
|
[ 'elements/videoconvert.c' ],
|
||||||
[ 'elements/videoconvert' ],
|
[ 'elements/videorate.c' ],
|
||||||
[ 'elements/videorate' ],
|
[ 'elements/videoscale.c' ],
|
||||||
[ 'elements/videoscale' ],
|
[ 'elements/videotestsrc.c' ],
|
||||||
[ 'elements/videotestsrc' ],
|
[ 'elements/volume.c', false, [ gst_controller_dep ] ],
|
||||||
[ 'elements/volume', false, [ gst_controller_dep ] ],
|
[ 'elements/vorbisdec.c', not vorbis_dep.found(), [ vorbis_dep, vorbisenc_dep ] ],
|
||||||
[ 'elements/vorbisdec', not vorbis_dep.found(), [ vorbis_dep, vorbisenc_dep ] ],
|
[ 'elements/vorbistag.c', not vorbisenc_dep.found(), [ vorbis_dep, vorbisenc_dep ] ],
|
||||||
[ 'elements/vorbistag', not vorbisenc_dep.found(), [ vorbis_dep, vorbisenc_dep ] ],
|
[ 'generic/clock-selection.c' ],
|
||||||
[ 'generic/clock-selection' ],
|
[ 'generic/states.c' ],
|
||||||
[ 'generic/states' ],
|
[ 'pipelines/simple-launch-lines.c' ],
|
||||||
[ 'pipelines/simple-launch-lines' ],
|
[ 'pipelines/basetime.c' ],
|
||||||
[ 'pipelines/basetime' ],
|
[ 'pipelines/capsfilter-renegotiation.c' ],
|
||||||
[ 'pipelines/capsfilter-renegotiation' ],
|
[ 'pipelines/gio.c' ],
|
||||||
[ 'pipelines/gio' ],
|
[ 'pipelines/oggmux.c', not ogg_dep.found(), [ ogg_dep, ] ],
|
||||||
[ 'pipelines/oggmux', not ogg_dep.found(), [ ogg_dep, ] ],
|
[ 'pipelines/streamsynchronizer.c' ],
|
||||||
[ 'pipelines/streamsynchronizer' ],
|
[ 'pipelines/tcp.c' ], # FIXME: -DHAVE_GIO_UNIX_2_0=1
|
||||||
[ 'pipelines/tcp' ], # FIXME: -DHAVE_GIO_UNIX_2_0=1
|
[ 'pipelines/theoraenc.c', not theoraenc_dep.found(), [ theoraenc_dep ] ],
|
||||||
[ 'pipelines/theoraenc', not theoraenc_dep.found(), [ theoraenc_dep ] ],
|
[ 'pipelines/vorbisenc.c', not vorbisenc_dep.found() ],
|
||||||
[ 'pipelines/vorbisenc', not vorbisenc_dep.found() ],
|
[ 'pipelines/vorbisdec.c', not vorbisenc_dep.found(),],
|
||||||
[ 'pipelines/vorbisdec', not vorbisenc_dep.found(),],
|
[ 'libs/gstlibscpp.cc', false, [ ] ],
|
||||||
]
|
]
|
||||||
|
|
||||||
# FIXME: enable orc testing
|
# FIXME: enable orc testing
|
||||||
|
@ -80,54 +80,67 @@ test_defines = [
|
||||||
'-UG_DISABLE_ASSERT',
|
'-UG_DISABLE_ASSERT',
|
||||||
'-UG_DISABLE_CAST_CHECKS',
|
'-UG_DISABLE_CAST_CHECKS',
|
||||||
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"',
|
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"',
|
||||||
'-DGST_TEST_FILES_PATH="' + meson.source_root() + '/tests/files"',
|
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
|
||||||
'-DGST_TEST_FILE="' + meson.source_root() + '/tests/files/partialframe.mjpeg"', # for libs/discoverer
|
'-DGST_TEST_FILE="' + meson.current_source_dir() + '/../files/partialframe.mjpeg"', # for libs/discoverer
|
||||||
'-DGST_USE_UNSTABLE_API',
|
'-DGST_USE_UNSTABLE_API',
|
||||||
]
|
]
|
||||||
|
|
||||||
getpluginsdir = find_program('getpluginsdir')
|
|
||||||
runcmd = run_command(getpluginsdir, 'gstreamer', 'gstreamer-1.0')
|
|
||||||
if runcmd.returncode() == 0
|
|
||||||
core_plugins_dir = runcmd.stdout().strip()
|
|
||||||
message('Using GStreamer plug-ins in ' + core_plugins_dir)
|
|
||||||
else
|
|
||||||
error('Could not determine GStreamer core plugins directory for unit tests.')
|
|
||||||
endif
|
|
||||||
|
|
||||||
test_env = [
|
|
||||||
'GST_PLUGIN_SYSTEM_PATH_1_0=',
|
|
||||||
'GST_PLUGIN_PATH_1_0=' + meson.build_root() + '/gst:' + meson.build_root() + '/ext:' + meson.build_root() + '/sys:' + core_plugins_dir,
|
|
||||||
'GST_PLUGIN_LOADING_WHITELIST=gstreamer:gst-plugins-base@' + meson.build_root(),
|
|
||||||
'GST_TAG_LICENSE_TRANSLATIONS_DICT=' + meson.source_root() + '/gst-libs/gst/tag/license-translations.dict',
|
|
||||||
'GST_STATE_IGNORE_ELEMENTS=cdio cdparanoiasrc libvisual_ alsasrc alsasink',
|
|
||||||
'CK_DEFAULT_TIMEOUT=20',
|
|
||||||
]
|
|
||||||
|
|
||||||
test_deps = [gst_dep, gst_base_dep, gst_net_dep, gst_check_dep, audio_dep,
|
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,
|
video_dep, pbutils_dep, rtp_dep, rtsp_dep, tag_dep, allocators_dep, app_dep,
|
||||||
fft_dep, riff_dep, sdp_dep, gio_dep] + glib_deps
|
fft_dep, riff_dep, sdp_dep, gio_dep] + glib_deps
|
||||||
|
|
||||||
foreach t : base_tests
|
pluginsdirs = [ ]
|
||||||
test_name = t.get(0)
|
# FIXME: Use if not gst_dep.is_internal() when avalaible as we only support the
|
||||||
extra_deps = [ ]
|
# case where GStreamer is another subproject here.
|
||||||
if t.length() == 3
|
if not meson.is_subproject()
|
||||||
extra_deps = t.get(2)
|
pkgconfig = find_program('pkg-config')
|
||||||
skip_test = t.get(1)
|
runcmd = run_command(pkgconfig, '--variable=pluginsdir',
|
||||||
elif t.length() == 2
|
'gstreamer-' + apiversion)
|
||||||
skip_test = t.get(1)
|
|
||||||
|
if runcmd.returncode() == 0
|
||||||
|
pluginsdirs = runcmd.stdout().split()
|
||||||
else
|
else
|
||||||
skip_test = false
|
error('Could not determine GStreamer core plugins directory for unit tests.')
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
foreach t : base_tests
|
||||||
|
fname = t.get(0)
|
||||||
|
test_name = fname.split('.').get(0)
|
||||||
|
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
|
if not skip_test
|
||||||
exe = executable(test_name, '@0@.c'.format(test_name),
|
exe = executable(test_name, fname,
|
||||||
include_directories : [configinc],
|
include_directories : [configinc],
|
||||||
c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
|
c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
|
||||||
|
cpp_args : gst_plugins_base_args,
|
||||||
dependencies : [libm] + test_deps + extra_deps,
|
dependencies : [libm] + test_deps + extra_deps,
|
||||||
)
|
)
|
||||||
test(test_name, exe,
|
|
||||||
env: test_env + ['GST_REGISTRY=@0@/@1@.registry'.format(meson.current_build_dir(), test_name)],
|
env = environment()
|
||||||
timeout: 3 * 60
|
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
|
||||||
)
|
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')
|
||||||
|
env.set('GST_TAG_LICENSE_TRANSLATIONS_DICT', gst_tag_dir + '/license-translations.dict')
|
||||||
|
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer',
|
||||||
|
'gst-plugins-base@' + meson.build_root(), separator=':')
|
||||||
|
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
|
||||||
|
|
||||||
|
foreach plugindir: pluginsdirs
|
||||||
|
env.append('GST_PLUGIN_PATH_1_0', plugindir)
|
||||||
|
endforeach
|
||||||
|
env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
|
||||||
|
test(test_name, exe, env: env, timeout: 3 * 60)
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
@ -138,14 +151,21 @@ foreach group : [1, 2, 3, 4, 5, 6]
|
||||||
include_directories : [configinc],
|
include_directories : [configinc],
|
||||||
c_args : ['-DHAVE_CONFIG_H=1', '-DVSCALE_TEST_GROUP=@0@'.format(group) ] + test_defines,
|
c_args : ['-DHAVE_CONFIG_H=1', '-DVSCALE_TEST_GROUP=@0@'.format(group) ] + test_defines,
|
||||||
dependencies : [libm] + test_deps + extra_deps)
|
dependencies : [libm] + test_deps + extra_deps)
|
||||||
test(vscale_test_name, exe,
|
|
||||||
env: test_env + ['GST_REGISTRY=@0@/@1@.registry'.format(meson.current_build_dir(), test_name)],
|
|
||||||
timeout: 3 * 60)
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
# ===============> FIXME <==========
|
# TODO Use env.copy when it is in meson
|
||||||
test('gstlibscpp', executable('gstlibscpp', 'libs/gstlibscpp.cc',
|
env = environment()
|
||||||
include_directories : [configinc],
|
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
|
||||||
cpp_args : gst_plugins_base_args,
|
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
|
||||||
dependencies : test_deps),
|
env.set('GST_STATE_IGNORE_ELEMENTS', 'cdio cdparanoiasrc libvisual_ alsasrc alsasink')
|
||||||
env: test_env + [ 'GST_REGISTRY=@0@/gstlibscpp.registry'.format(meson.current_build_dir()) ])
|
env.set('CK_DEFAULT_TIMEOUT', '20')
|
||||||
|
env.set('GST_TAG_LICENSE_TRANSLATIONS_DICT', gst_tag_dir + '/license-translations.dict')
|
||||||
|
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer',
|
||||||
|
'gst-plugins-base@' + meson.build_root(), separator=':')
|
||||||
|
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
|
||||||
|
foreach plugindir: pluginsdirs
|
||||||
|
env.append('GST_PLUGIN_PATH_1_0', plugindir)
|
||||||
|
endforeach
|
||||||
|
env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
|
||||||
|
|
||||||
|
test(vscale_test_name, exe, env: env, timeout: 3 * 60)
|
||||||
|
endforeach
|
||||||
|
|
Loading…
Reference in a new issue