2016-08-12 14:55:17 +00:00
|
|
|
have_debug = true # FIXME
|
|
|
|
|
|
|
|
# tests and condition when to skip the test
|
|
|
|
core_tests = [
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gst.c', not gst_registry ],
|
|
|
|
[ 'gst/gstabi.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstatomicqueue.c' ],
|
|
|
|
[ 'gst/gstbuffer.c' ],
|
|
|
|
[ 'gst/gstbufferlist.c' ],
|
|
|
|
[ 'gst/gstbufferpool.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstchildproxy.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstclock.c' ],
|
|
|
|
[ 'gst/gstcontext.c' ],
|
|
|
|
[ 'gst/gstcontroller.c' ],
|
|
|
|
[ 'gst/gstcaps.c' ],
|
|
|
|
[ 'gst/gstcapsfeatures.c' ],
|
|
|
|
[ 'gst/gstdatetime.c' ],
|
2017-12-24 15:21:38 +00:00
|
|
|
[ 'gst/gstdeinit.c' ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstdevice.c' ],
|
2018-08-09 23:08:43 +00:00
|
|
|
[ 'gst/gstelement.c', not gst_registry or not gst_parse],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstelementfactory.c', not gst_registry ],
|
|
|
|
[ 'gst/gstghostpad.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstinfo.c' ],
|
|
|
|
[ 'gst/gstiterator.c' ],
|
|
|
|
[ 'gst/gstmessage.c' ],
|
|
|
|
[ 'gst/gstmemory.c' ],
|
|
|
|
[ 'gst/gstmeta.c' ],
|
|
|
|
[ 'gst/gstminiobject.c' ],
|
|
|
|
[ 'gst/gstobject.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstpad.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstparamspecs.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstprintf.c', not gst_debug, printf_lib],
|
|
|
|
[ 'gst/gstpipeline.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstpoll.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstplugin.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstpreset.c' ],
|
|
|
|
[ 'gst/gstprotection.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstquery.c', not gst_registry ],
|
|
|
|
[ 'gst/gstregistry.c', not gst_registry ],
|
2017-04-03 12:20:51 +00:00
|
|
|
[ 'gst/gstpromise.c'],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstsegment.c' ],
|
|
|
|
[ 'gst/gststream.c' ],
|
|
|
|
[ 'gst/gststructure.c' ],
|
|
|
|
[ 'gst/gstsystemclock.c' ],
|
|
|
|
[ 'gst/gsttag.c' ],
|
|
|
|
[ 'gst/gsttagsetter.c' ],
|
|
|
|
[ 'gst/gsttask.c' ],
|
|
|
|
[ 'gst/gsttoc.c' ],
|
|
|
|
[ 'gst/gsttocsetter.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gsttracerrecord.c', not tracer_hooks or not gst_debug],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gsturi.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstutils.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'gst/gstvalue.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'generic/states.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'libs/adapter.c' ],
|
2017-12-02 15:24:22 +00:00
|
|
|
[ 'libs/aggregator.c' ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'libs/baseparse.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'libs/basesrc.c', not gst_registry ],
|
|
|
|
[ 'libs/basesink.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'libs/bitreader.c' ],
|
2014-03-18 14:01:04 +00:00
|
|
|
[ 'libs/bitwriter.c' ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'libs/bytereader.c' ],
|
|
|
|
[ 'libs/bytewriter.c' ],
|
|
|
|
[ 'libs/bitreader-noinline.c' ],
|
|
|
|
[ 'libs/bytereader-noinline.c' ],
|
|
|
|
[ 'libs/bytewriter-noinline.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'libs/collectpads.c', not gst_registry ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'libs/controller.c' ],
|
|
|
|
[ 'libs/flowcombiner.c' ],
|
2018-08-09 23:08:43 +00:00
|
|
|
[ 'libs/gstharness.c', not gst_parse ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'libs/gstnetclientclock.c' ],
|
|
|
|
[ 'libs/gstnettimeprovider.c' ],
|
|
|
|
[ 'libs/gsttestclock.c' ],
|
|
|
|
[ 'libs/libsabi.c' ],
|
|
|
|
[ 'libs/sparsefile.c' ],
|
|
|
|
[ 'libs/transform1.c' ],
|
|
|
|
[ 'libs/transform2.c' ],
|
|
|
|
[ 'libs/typefindhelper.c' ],
|
|
|
|
[ 'libs/queuearray.c' ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'elements/capsfilter.c', not gst_registry ],
|
|
|
|
[ 'elements/concat.c', not gst_registry ],
|
|
|
|
[ 'elements/dataurisrc.c', not gst_registry ],
|
|
|
|
[ 'elements/fakesrc.c', not gst_registry ],
|
|
|
|
[ 'elements/fdsrc.c', not gst_registry ],
|
|
|
|
[ 'elements/filesink.c', not gst_registry ],
|
|
|
|
[ 'elements/filesrc.c', not gst_registry ],
|
|
|
|
[ 'elements/funnel.c', not gst_registry ],
|
2018-08-09 23:08:43 +00:00
|
|
|
[ 'elements/identity.c', not gst_registry or not gst_parse ],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'elements/multiqueue.c', not gst_registry ],
|
|
|
|
[ 'elements/selector.c', not gst_registry ],
|
|
|
|
[ 'elements/streamiddemux.c', not gst_registry ],
|
2018-08-09 23:08:43 +00:00
|
|
|
[ 'elements/tee.c', not gst_registry or not gst_parse],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'elements/queue.c', not gst_registry ],
|
2018-08-09 23:08:43 +00:00
|
|
|
[ 'elements/queue2.c', not gst_registry or not gst_parse],
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'elements/valve.c', not gst_registry ],
|
|
|
|
[ 'pipelines/seek.c', not gst_registry ],
|
2018-08-09 23:08:43 +00:00
|
|
|
[ 'pipelines/queue-error.c', not gst_registry or not gst_parse],
|
|
|
|
[ 'pipelines/parse-disabled.c', gst_parse ],
|
|
|
|
[ 'pipelines/simple-launch-lines.c', not gst_parse ],
|
|
|
|
[ 'pipelines/parse-launch.c', not gst_parse ],
|
|
|
|
[ 'pipelines/cleanup.c', not gst_parse ],
|
2016-10-04 12:20:37 +00:00
|
|
|
[ 'tools/gstinspect.c' ],
|
2016-08-12 14:55:17 +00:00
|
|
|
# These take quite long, put them at the end
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'elements/fakesink.c', not gst_registry ],
|
|
|
|
[ 'gst/gstbin.c', not gst_registry ],
|
|
|
|
[ 'gst/gstbus.c', not gst_registry ],
|
|
|
|
[ 'gst/gstevent.c', not gst_registry ],
|
|
|
|
[ 'pipelines/stress.c', not gst_registry ],
|
|
|
|
[ 'generic/sinks.c', not gst_registry ],
|
2016-08-12 14:55:17 +00:00
|
|
|
]
|
|
|
|
|
2017-05-21 08:02:54 +00:00
|
|
|
# Make sure our headers are C++ clean
|
|
|
|
if add_languages('cpp', required : false)
|
|
|
|
core_tests += [
|
2018-05-05 13:38:09 +00:00
|
|
|
[ 'gst/gstcpp.cc', not gst_registry ],
|
2017-05-21 08:02:54 +00:00
|
|
|
[ 'libs/gstlibscpp.cc', false ],
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
test_defines = [
|
|
|
|
'-UG_DISABLE_ASSERT',
|
|
|
|
'-UG_DISABLE_CAST_CHECKS',
|
|
|
|
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
|
|
|
|
'-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
|
|
|
|
'-DGST_USE_UNSTABLE_API',
|
2017-06-15 09:51:50 +00:00
|
|
|
'-DGST_DISABLE_DEPRECATED',
|
2016-08-12 14:55:17 +00:00
|
|
|
]
|
|
|
|
|
2018-08-10 00:23:35 +00:00
|
|
|
# sanity checking
|
|
|
|
if get_option('check').disabled()
|
|
|
|
if get_option('tests').enabled()
|
|
|
|
error('Building of unit tests was requested, but GStreamer check library was disabled.')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
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]
|
|
|
|
|
|
|
|
foreach t : core_tests
|
2017-12-05 06:57:18 +00:00
|
|
|
fname = t[0]
|
|
|
|
test_name = fname.split('.')[0].underscorify()
|
2017-05-15 23:02:11 +00:00
|
|
|
skip_test = t.get(1, false)
|
|
|
|
link_with_libs = t.get(2, [])
|
|
|
|
|
2016-08-12 14:55:17 +00:00
|
|
|
if not skip_test
|
2016-10-04 12:20:37 +00:00
|
|
|
exe = executable(test_name, fname,
|
|
|
|
c_args : gst_c_args + test_defines,
|
|
|
|
cpp_args : gst_c_args + test_defines,
|
|
|
|
include_directories : [configinc],
|
2017-05-15 23:02:11 +00:00
|
|
|
link_with : link_with_libs,
|
2016-12-21 18:19:11 +00:00
|
|
|
dependencies : test_deps + glib_deps + gst_deps,
|
2016-08-12 14:55:17 +00:00
|
|
|
)
|
|
|
|
|
2016-10-04 12:20:37 +00:00
|
|
|
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')
|
2016-08-12 14:55:17 +00:00
|
|
|
|
2016-10-04 12:20:37 +00:00
|
|
|
test(test_name, exe, env: env, timeout : 3 * 60)
|
|
|
|
endif
|
|
|
|
endforeach
|