2d11e0a74e6ccb357698313349f6904ca8947c8c
[platform/upstream/gstreamer.git] / tests / check / meson.build
1 have_registry = not get_option('disable_registry')
2 have_debug = true # FIXME
3 have_parse = true # FIXME
4
5 # tests and condition when to skip the test
6 core_tests = [
7   [ 'gst/gst.c', not have_registry ],
8   [ 'gst/gstabi.c', not have_registry ],
9   [ 'gst/gstatomicqueue.c' ],
10   [ 'gst/gstbuffer.c' ],
11   [ 'gst/gstbufferlist.c' ],
12   [ 'gst/gstbufferpool.c' ],
13   [ 'gst/gstchildproxy.c', not have_registry ],
14   [ 'gst/gstclock.c' ],
15   [ 'gst/gstcontext.c' ],
16   [ 'gst/gstcontroller.c' ],
17   [ 'gst/gstcaps.c' ],
18   [ 'gst/gstcapsfeatures.c' ],
19   [ 'gst/gstdatetime.c' ],
20   [ 'gst/gstdevice.c' ],
21   [ 'gst/gstelement.c', not have_registry ],
22   [ 'gst/gstelementfactory.c', not have_registry ],
23   [ 'gst/gstghostpad.c', not have_registry ],
24   [ 'gst/gstinfo.c' ],
25   [ 'gst/gstiterator.c' ],
26   [ 'gst/gstmessage.c' ],
27   [ 'gst/gstmemory.c' ],
28   [ 'gst/gstmeta.c' ],
29   [ 'gst/gstminiobject.c' ],
30   [ 'gst/gstobject.c' ],
31   [ 'gst/gstpad.c', not have_registry ],
32   [ 'gst/gstparamspecs.c' ],
33   [ 'gst/gstprintf.c', disable_gst_debug, printf_lib],
34   [ 'gst/gstpipeline.c', not have_registry ],
35   [ 'gst/gstpoll.c' ],
36   [ 'gst/gstplugin.c', not have_registry ],
37   [ 'gst/gstpreset.c' ],
38   [ 'gst/gstprotection.c' ],
39   [ 'gst/gstquery.c', not have_registry ],
40   [ 'gst/gstregistry.c', not have_registry ],
41   [ 'gst/gstsegment.c' ],
42   [ 'gst/gststream.c' ],
43   [ 'gst/gststructure.c' ],
44   [ 'gst/gstsystemclock.c' ],
45   [ 'gst/gsttag.c' ],
46   [ 'gst/gsttagsetter.c' ],
47   [ 'gst/gsttask.c' ],
48   [ 'gst/gsttoc.c' ],
49   [ 'gst/gsttocsetter.c' ],
50   [ 'gst/gsttracerrecord.c' ],
51   [ 'gst/gsturi.c' ],
52   [ 'gst/gstutils.c', not have_registry ],
53   [ 'gst/gstvalue.c' ],
54   [ 'generic/states.c', not have_registry ],
55   [ 'libs/adapter.c' ],
56   [ 'libs/baseparse.c' ],
57   [ 'libs/basesrc.c', not have_registry ],
58   [ 'libs/basesink.c', not have_registry ],
59   [ 'libs/bitreader.c' ],
60   [ 'libs/bytereader.c' ],
61   [ 'libs/bytewriter.c' ],
62   [ 'libs/bitreader-noinline.c' ],
63   [ 'libs/bytereader-noinline.c' ],
64   [ 'libs/bytewriter-noinline.c' ],
65   [ 'libs/collectpads.c', not have_registry ],
66   [ 'libs/controller.c' ],
67   [ 'libs/flowcombiner.c' ],
68   [ 'libs/gstharness.c' ],
69   [ 'libs/gstnetclientclock.c' ],
70   [ 'libs/gstnettimeprovider.c' ],
71   [ 'libs/gsttestclock.c' ],
72   [ 'libs/libsabi.c' ],
73   [ 'libs/sparsefile.c' ],
74   [ 'libs/transform1.c' ],
75   [ 'libs/transform2.c' ],
76   [ 'libs/typefindhelper.c' ],
77   [ 'libs/queuearray.c' ],
78   [ 'elements/capsfilter.c', not have_registry ],
79   [ 'elements/concat.c', not have_registry ],
80   [ 'elements/dataurisrc.c', not have_registry ],
81   [ 'elements/fakesrc.c', not have_registry ],
82   [ 'elements/fdsrc.c', not have_registry ],
83   [ 'elements/filesink.c', not have_registry ],
84   [ 'elements/filesrc.c', not have_registry ],
85   [ 'elements/funnel.c', not have_registry ],
86   [ 'elements/identity.c', not have_registry ],
87   [ 'elements/multiqueue.c', not have_registry ],
88   [ 'elements/selector.c', not have_registry ],
89   [ 'elements/streamiddemux.c', not have_registry ],
90   [ 'elements/tee.c', not have_registry ],
91   [ 'elements/queue.c', not have_registry ],
92   [ 'elements/queue2.c', not have_registry ],
93   [ 'elements/valve.c', not have_registry ],
94   [ 'pipelines/seek.c', not have_registry ],
95   [ 'pipelines/queue-error.c', not have_registry ],
96   [ 'pipelines/parse-disabled.c', have_parse ],
97   [ 'pipelines/simple-launch-lines.c', not have_parse ],
98   [ 'pipelines/parse-launch.c', not have_parse ],
99   [ 'pipelines/cleanup.c', not have_parse ],
100   [ 'tools/gstinspect.c' ],
101   # These take quite long, put them at the end
102   [ 'elements/fakesink.c', not have_registry ],
103   [ 'gst/gstbin.c', not have_registry ],
104   [ 'gst/gstbus.c', not have_registry ],
105   [ 'gst/gstevent.c', not have_registry ],
106   [ 'pipelines/stress.c', not have_registry ],
107   [ 'generic/sinks.c', not have_registry ],
108 ]
109
110 # Make sure our headers are C++ clean
111 if add_languages('cpp', required : false)
112   core_tests += [
113     [ 'gst/gstcpp.cc', not have_registry ],
114     [ 'libs/gstlibscpp.cc', false ],
115   ]
116 endif
117
118 test_defines = [
119   '-UG_DISABLE_ASSERT',
120   '-UG_DISABLE_CAST_CHECKS',
121   '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
122   '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
123   '-DGST_USE_UNSTABLE_API',
124 ]
125
126 glib_deps = [gio_dep, gobject_dep, gmodule_dep, glib_dep]
127 gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep]
128
129 foreach t : core_tests
130   fname = t.get(0)
131   test_name = fname.split('.').get(0)
132   skip_test = t.get(1, false)
133   link_with_libs = t.get(2, [])
134
135   if not skip_test
136     exe = executable(test_name, fname,
137         c_args : gst_c_args + test_defines,
138         cpp_args : gst_c_args + test_defines,
139         include_directories : [configinc],
140         link_with : link_with_libs,
141         dependencies : test_deps + glib_deps + gst_deps,
142     )
143
144     env = environment()
145     env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
146     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
147     env.set('GST_STATE_IGNORE_ELEMENTS', '')
148     env.set('CK_DEFAULT_TIMEOUT', '20')
149     env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
150     env.set('GST_PLUGIN_SCANNER_1_0', gst_scanner_dir + '/gst-plugin-scanner')
151     env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer')
152
153     test(test_name, exe, env: env, timeout : 3 * 60)
154   endif
155 endforeach