meson: Make use of new environment object and set plugin path to builddir

- Properly set where to find gst-plugin-scanner
- Use GST_LOADING_WHITELIST so that only core plugins are used

Bump meson requirement to 0.35
This commit is contained in:
Thibault Saunier 2016-10-04 09:20:37 -03:00
parent 35a34d2fa8
commit 2be7e4758b
3 changed files with 122 additions and 131 deletions

View file

@ -8,5 +8,7 @@ gst_plugin_scanner = executable('gst-plugin-scanner',
install: true, install: true,
) )
gst_scanner_dir = meson.current_build_dir()
# FIXME: gst-ptp-helper # FIXME: gst-ptp-helper
# FIXME: gst-completion-helper # FIXME: gst-completion-helper

View file

@ -1,6 +1,6 @@
project('gstreamer', 'c', 'cpp', project('gstreamer', '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=c99', 'c_std=c99',
'buildtype=debugoptimized' ]) 'buildtype=debugoptimized' ])

View file

@ -4,106 +4,108 @@ have_parse = true # FIXME
# tests and condition when to skip the test # tests and condition when to skip the test
core_tests = [ core_tests = [
[ 'gst/gst', not have_registry ], [ 'gst/gst.c', not have_registry ],
[ 'gst/gstabi', not have_registry ], [ 'gst/gstabi.c', not have_registry ],
[ 'gst/gstatomicqueue' ], [ 'gst/gstatomicqueue.c' ],
[ 'gst/gstbuffer' ], [ 'gst/gstbuffer.c' ],
[ 'gst/gstbufferlist' ], [ 'gst/gstbufferlist.c' ],
[ 'gst/gstbufferpool' ], [ 'gst/gstbufferpool.c' ],
[ 'gst/gstchildproxy', not have_registry ], [ 'gst/gstchildproxy.c', not have_registry ],
[ 'gst/gstclock' ], [ 'gst/gstclock.c' ],
[ 'gst/gstcontext' ], [ 'gst/gstcontext.c' ],
[ 'gst/gstcontroller' ], [ 'gst/gstcontroller.c' ],
[ 'gst/gstcaps' ], [ 'gst/gstcaps.c' ],
[ 'gst/gstcapsfeatures' ], [ 'gst/gstcapsfeatures.c' ],
[ 'gst/gstdatetime' ], [ 'gst/gstdatetime.c' ],
[ 'gst/gstdevice' ], [ 'gst/gstdevice.c' ],
[ 'gst/gstelement', not have_registry ], [ 'gst/gstelement.c', not have_registry ],
[ 'gst/gstelementfactory', not have_registry ], [ 'gst/gstelementfactory.c', not have_registry ],
[ 'gst/gstghostpad', not have_registry ], [ 'gst/gstghostpad.c', not have_registry ],
[ 'gst/gstinfo' ], [ 'gst/gstinfo.c' ],
[ 'gst/gstiterator' ], [ 'gst/gstiterator.c' ],
[ 'gst/gstmessage' ], [ 'gst/gstmessage.c' ],
[ 'gst/gstmemory' ], [ 'gst/gstmemory.c' ],
[ 'gst/gstmeta' ], [ 'gst/gstmeta.c' ],
[ 'gst/gstminiobject' ], [ 'gst/gstminiobject.c' ],
[ 'gst/gstobject' ], [ 'gst/gstobject.c' ],
[ 'gst/gstpad', not have_registry ], [ 'gst/gstpad.c', not have_registry ],
[ 'gst/gstparamspecs' ], [ 'gst/gstparamspecs.c' ],
[ 'gst/gstprintf', not have_debug ], [ 'gst/gstprintf.c', not have_debug ],
[ 'gst/gstpipeline', not have_registry ], [ 'gst/gstpipeline.c', not have_registry ],
[ 'gst/gstpoll' ], [ 'gst/gstpoll.c' ],
[ 'gst/gstplugin', not have_registry ], [ 'gst/gstplugin.c', not have_registry ],
[ 'gst/gstpreset' ], [ 'gst/gstpreset.c' ],
[ 'gst/gstprotection' ], [ 'gst/gstprotection.c' ],
[ 'gst/gstquery', not have_registry ], [ 'gst/gstquery.c', not have_registry ],
[ 'gst/gstregistry', not have_registry ], [ 'gst/gstregistry.c', not have_registry ],
[ 'gst/gstsegment' ], [ 'gst/gstsegment.c' ],
[ 'gst/gststream' ], [ 'gst/gststream.c' ],
[ 'gst/gststructure' ], [ 'gst/gststructure.c' ],
[ 'gst/gstsystemclock' ], [ 'gst/gstsystemclock.c' ],
[ 'gst/gsttag' ], [ 'gst/gsttag.c' ],
[ 'gst/gsttagsetter' ], [ 'gst/gsttagsetter.c' ],
[ 'gst/gsttask' ], [ 'gst/gsttask.c' ],
[ 'gst/gsttoc' ], [ 'gst/gsttoc.c' ],
[ 'gst/gsttocsetter' ], [ 'gst/gsttocsetter.c' ],
[ 'gst/gsttracerrecord' ], [ 'gst/gsttracerrecord.c' ],
[ 'gst/gsturi' ], [ 'gst/gsturi.c' ],
[ 'gst/gstutils', not have_registry ], [ 'gst/gstutils.c', not have_registry ],
[ 'gst/gstvalue' ], [ 'gst/gstvalue.c' ],
[ 'generic/states', not have_registry ], [ 'generic/states.c', not have_registry ],
[ 'libs/adapter' ], [ 'libs/adapter.c' ],
[ 'libs/baseparse' ], [ 'libs/baseparse.c' ],
[ 'libs/basesrc', not have_registry ], [ 'libs/basesrc.c', not have_registry ],
[ 'libs/basesink', not have_registry ], [ 'libs/basesink.c', not have_registry ],
[ 'libs/bitreader' ], [ 'libs/bitreader.c' ],
[ 'libs/bytereader' ], [ 'libs/bytereader.c' ],
[ 'libs/bytewriter' ], [ 'libs/bytewriter.c' ],
[ 'libs/bitreader-noinline' ], [ 'libs/bitreader-noinline.c' ],
[ 'libs/bytereader-noinline' ], [ 'libs/bytereader-noinline.c' ],
[ 'libs/bytewriter-noinline' ], [ 'libs/bytewriter-noinline.c' ],
[ 'libs/collectpads', not have_registry ], [ 'libs/collectpads.c', not have_registry ],
[ 'libs/controller' ], [ 'libs/controller.c' ],
[ 'libs/flowcombiner' ], [ 'libs/flowcombiner.c' ],
[ 'libs/gstharness' ], [ 'libs/gstharness.c' ],
[ 'libs/gstnetclientclock' ], [ 'libs/gstnetclientclock.c' ],
[ 'libs/gstnettimeprovider' ], [ 'libs/gstnettimeprovider.c' ],
[ 'libs/gsttestclock' ], [ 'libs/gsttestclock.c' ],
[ 'libs/libsabi' ], [ 'libs/libsabi.c' ],
[ 'libs/sparsefile' ], [ 'libs/sparsefile.c' ],
[ 'libs/transform1' ], [ 'libs/transform1.c' ],
[ 'libs/transform2' ], [ 'libs/transform2.c' ],
[ 'libs/typefindhelper' ], [ 'libs/typefindhelper.c' ],
[ 'libs/queuearray' ], [ 'libs/queuearray.c' ],
[ 'elements/capsfilter', not have_registry ], [ 'elements/capsfilter.c', not have_registry ],
[ 'elements/concat', not have_registry ], [ 'elements/concat.c', not have_registry ],
[ 'elements/fakesrc', not have_registry ], [ 'elements/fakesrc.c', not have_registry ],
[ 'elements/fdsrc', not have_registry ], [ 'elements/fdsrc.c', not have_registry ],
[ 'elements/filesink', not have_registry ], [ 'elements/filesink.c', not have_registry ],
[ 'elements/filesrc', not have_registry ], [ 'elements/filesrc.c', not have_registry ],
[ 'elements/funnel', not have_registry ], [ 'elements/funnel.c', not have_registry ],
[ 'elements/identity', not have_registry ], [ 'elements/identity.c', not have_registry ],
[ 'elements/multiqueue', not have_registry ], [ 'elements/multiqueue.c', not have_registry ],
[ 'elements/selector', not have_registry ], [ 'elements/selector.c', not have_registry ],
[ 'elements/streamiddemux', not have_registry ], [ 'elements/streamiddemux.c', not have_registry ],
[ 'elements/tee', not have_registry ], [ 'elements/tee.c', not have_registry ],
[ 'elements/queue', not have_registry ], [ 'elements/queue.c', not have_registry ],
[ 'elements/queue2', not have_registry ], [ 'elements/queue2.c', not have_registry ],
[ 'elements/valve', not have_registry ], [ 'elements/valve.c', not have_registry ],
[ 'pipelines/seek', not have_registry ], [ 'pipelines/seek.c', not have_registry ],
[ 'pipelines/queue-error', not have_registry ], [ 'pipelines/queue-error.c', not have_registry ],
[ 'pipelines/parse-disabled', have_parse ], [ 'pipelines/parse-disabled.c', have_parse ],
[ 'pipelines/simple-launch-lines', not have_parse ], [ 'pipelines/simple-launch-lines.c', not have_parse ],
[ 'pipelines/parse-launch', not have_parse ], [ 'pipelines/parse-launch.c', not have_parse ],
[ 'pipelines/cleanup', not have_parse ], [ 'pipelines/cleanup.c', not have_parse ],
[ 'tools/gstinspect' ], [ 'tools/gstinspect.c' ],
# These take quite long, put them at the end # These take quite long, put them at the end
[ 'elements/fakesink', not have_registry ], [ 'elements/fakesink.c', not have_registry ],
[ 'gst/gstbin', not have_registry ], [ 'gst/gstbin.c', not have_registry ],
[ 'gst/gstbus', not have_registry ], [ 'gst/gstbus.c', not have_registry ],
[ 'gst/gstevent', not have_registry ], [ 'gst/gstevent.c', not have_registry ],
[ 'pipelines/stress', not have_registry ], [ 'pipelines/stress.c', not have_registry ],
[ 'generic/sinks', not have_registry ], [ 'generic/sinks.c', not have_registry ],
[ 'gst/gstcpp.cc', not have_registry ],
[ 'libs/gstlibscpp.cc', false ],
] ]
test_defines = [ test_defines = [
@ -114,47 +116,34 @@ test_defines = [
'-DGST_USE_UNSTABLE_API', '-DGST_USE_UNSTABLE_API',
] ]
test_env = [
'GST_PLUGIN_SYSTEM_PATH_1_0=',
'GST_PLUGIN_PATH_1_0=' + meson.build_root() + '/plugins',
'GST_PLUGIN_SCANNER_1_0='+ meson.build_root() + '/libs/gst/helpers/gst-plugin-scanner',
'GST_STATE_IGNORE_ELEMENTS=',
'CK_DEFAULT_TIMEOUT=20',
]
glib_deps = [gio_dep, gobject_dep, gmodule_dep, glib_dep] glib_deps = [gio_dep, gobject_dep, gmodule_dep, glib_dep]
gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep] gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep]
foreach t : core_tests foreach t : core_tests
test_name = t.get(0) fname = t.get(0)
test_name = fname.split('.').get(0)
if t.length() == 2 if t.length() == 2
skip_test = t.get(1) skip_test = t.get(1)
else else
skip_test = false skip_test = false
endif endif
if not skip_test if not skip_test
exe = executable(test_name, '@0@.c'.format(test_name), exe = executable(test_name, fname,
c_args : gst_c_args + test_defines, c_args : gst_c_args + test_defines,
include_directories : [configinc], cpp_args : gst_c_args + test_defines,
dependencies : glib_deps + gst_deps, include_directories : [configinc],
) dependencies : glib_deps + gst_deps,
test(test_name, exe,
env: test_env + ['GST_REGISTRY=@0@/@1@.registry'.format(meson.current_build_dir(), test_name)],
timeout : 3 * 60
) )
env = environment()
env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
env.set('GST_STATE_IGNORE_ELEMENTS', '')
env.set('CK_DEFAULT_TIMEOUT', '20')
env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
env.set('GST_PLUGIN_SCANNER_1_0', gst_scanner_dir + '/gst-plugin-scanner')
env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer')
test(test_name, exe, env: env, timeout : 3 * 60)
endif endif
endforeach endforeach
if have_registry
test('gstcpp', executable('gstcpp', 'gst/gstcpp.cc',
cpp_args : gst_c_args + test_defines,
include_directories : [configinc],
dependencies : glib_deps + gst_deps),
env: test_env + ['GST_REGISTRY=@0@/gstcpp.registry'.format(meson.current_build_dir())])
endif
test('gstlibscpp', executable('gstlibscpp', 'libs/gstlibscpp.cc',
cpp_args : gst_c_args,
include_directories : [configinc],
dependencies : glib_deps + gst_deps),
env: test_env + ['GST_REGISTRY=@0@/gstlibscpp.registry'.format(meson.current_build_dir())])