gstreamer/subprojects/gst-plugins-ugly/tests/check/meson.build

82 lines
2.7 KiB
Meson
Raw Normal View History

2016-09-24 07:59:55 +00:00
# name, condition when to skip the test and extra dependencies
ugly_tests = [
[ 'elements/x264enc', not x264_dep.found(), [ x264_dep, gmodule_dep ] ],
2016-09-24 07:59:55 +00:00
[ 'elements/xingmux' ],
[ 'generic/states' ],
2016-09-24 07:59:55 +00:00
]
# FIXME: unistd dependency or not tested yet on windows
if host_machine.system() != 'windows'
ugly_tests += [
[ 'elements/amrnbenc', not amrnb_dep.found() ],
[ 'elements/mpeg2dec', not mpeg2_dep.found() or not cdata.has('HAVE_UNISTD_H'), [ gstvideo_dep ] ],
]
endif
2016-09-24 07:59:55 +00:00
test_defines = [
'-UG_DISABLE_ASSERT',
'-UG_DISABLE_CAST_CHECKS',
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"',
'-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
2016-09-24 07:59:55 +00:00
'-DGST_USE_UNSTABLE_API',
]
pluginsdirs = []
if gst_dep.type_name() == 'pkgconfig'
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/53>
2020-05-27 13:42:20 +00:00
pbase = dependency('gstreamer-plugins-base-' + api_version, required: true)
pluginsdirs = [gst_dep.get_variable('pluginsdir'),
pbase.get_variable('pluginsdir')]
gst_plugin_scanner_dir = gst_dep.get_variable('pluginscannerdir')
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/53>
2020-05-27 13:42:20 +00:00
else
gst_plugin_scanner_dir = subproject('gstreamer').get_variable('gst_scanner_dir')
endif
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/53>
2020-05-27 13:42:20 +00:00
gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
2016-09-24 07:59:55 +00:00
test_deps = [gst_dep, gstbase_dep, gstcheck_dep, gstaudio_dep, gstapp_dep,
gstfft_dep, gstvideo_dep, gstpbutils_dep]
2016-09-24 07:59:55 +00:00
libm = cc.find_library('m', required : false)
# FIXME: valgrind_args: add suppressions $(top_srcdir)/common/gst.supp $(srcdir)/gst-plugins-ugly.supp
2018-03-01 18:07:42 +00:00
no_warn_args = []
foreach arg : [
'-Wno-missing-prototypes',
'-Wno-missing-declarations',
'-Wno-old-style-definition']
if cc.has_argument(arg)
no_warn_args += [arg]
endif
endforeach
2016-09-24 07:59:55 +00:00
foreach t : ugly_tests
fname = '@0@.c'.format(t.get(0))
test_name = t.get(0).underscorify()
2016-09-24 07:59:55 +00:00
extra_deps = [ ]
if t.length() == 3
extra_deps = t.get(2)
skip_test = t.get(1)
elif t.length() == 2
skip_test = t.get(1)
else
skip_test = false
endif
if not skip_test
exe = executable(test_name, fname,
2016-09-24 07:59:55 +00:00
include_directories : [configinc],
2018-03-01 18:07:42 +00:00
c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines + no_warn_args,
2016-09-24 07:59:55 +00:00
dependencies : [libm] + test_deps + extra_deps,
)
env = environment()
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
env.set('CK_DEFAULT_TIMEOUT', '20')
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
'gst-plugins-good', 'gst-plugins-ugly@' + meson.project_build_root())
env.set('GST_PLUGIN_PATH_1_0', [meson.global_build_root()] + pluginsdirs)
2018-12-18 13:48:42 +00:00
env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name)))
tests: fix meson test env setup to make sure we use the right gst-plugin-scanner If core is built as a subproject (e.g. as in gst-build), make sure to use the gst-plugin-scanner from the built subproject. Without this, gstreamer might accidentally use the gst-plugin-scanner from the install prefix if that exists, which in turn might drag in gst library versions we didn't mean to drag in. Those gst library versions might then be older than what our current build needs, and might cause our newly-built plugins to get blacklisted in the test registry because they rely on a symbol that the wrongly-pulled in gst lib doesn't have. This should fix running of unit tests in gst-build when invoking meson test or ninja test from outside the devenv for the case where there is an older or different-version gst-plugin-scanner installed in the install prefix. In case no gst-plugin-scanner is installed in the install prefix, this will fix "GStreamer-WARNING: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual." warnings when running the unit tests. In the case where we find GStreamer core via pkg-config we use a newly-added pkg-config var "pluginscannerdir" to get the right directory. This has the benefit of working transparently for both installed and uninstalled pkg-config files/setups. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/53>
2020-05-27 13:42:20 +00:00
env.set('GST_PLUGIN_SCANNER_1_0', gst_plugin_scanner_path)
test(test_name, exe, env: env, timeout: 3 * 60)
2016-09-24 07:59:55 +00:00
endif
endforeach