Remove mpg123 plugin, moved to -good
[platform/upstream/gst-plugins-ugly.git] / tests / check / meson.build
1 # name, condition when to skip the test and extra dependencies
2 ugly_tests = [
3   [ 'elements/amrnbenc', not amrnb_dep.found() ],
4   [ 'elements/mpeg2dec', not mpeg2_dep.found(), [ gstvideo_dep ] ],
5   [ 'elements/x264enc', not x264_dep.found() ],
6   [ 'elements/xingmux' ],
7   [ 'generic/states' ],
8   [ 'pipelines/lame', not lame_dep.found() ],
9 ]
10
11 test_defines = [
12   '-UG_DISABLE_ASSERT',
13   '-UG_DISABLE_CAST_CHECKS',
14   '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"',
15   '-DGST_TEST_FILES_PATH="' + meson.current_source_dir() + '/../files"',
16   '-DGST_USE_UNSTABLE_API',
17 ]
18
19 pluginsdirs = []
20 if gst_dep.type_name() == 'pkgconfig'
21   pbase = dependency('gstreamer-plugins-base-' + api_version, required : false)
22   pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir'),
23                  pbase.get_pkgconfig_variable('pluginsdir')]
24 endif
25
26 test_deps = [gst_dep, gstbase_dep, gstcheck_dep, gstaudio_dep, gstapp_dep, gstfft_dep]
27
28 libm = cc.find_library('m', required : false)
29
30 # FIXME: valgrind_args: add suppressions $(top_srcdir)/common/gst.supp $(srcdir)/gst-plugins-ugly.supp
31
32 foreach t : ugly_tests
33   fname = '@0@.c'.format(t.get(0))
34   test_name = t.get(0).underscorify()
35   extra_deps = [ ]
36   if t.length() == 3
37     extra_deps = t.get(2)
38     skip_test = t.get(1)
39   elif t.length() == 2
40     skip_test = t.get(1)
41   else
42     skip_test = false
43   endif
44   if not skip_test
45     exe = executable(test_name, fname,
46       include_directories : [configinc],
47       c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
48       dependencies : [libm] + test_deps + extra_deps,
49     )
50
51     env = environment()
52     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
53     env.set('CK_DEFAULT_TIMEOUT', '20')
54     env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
55       'gst-plugins-good', 'gst-plugins-ugly@' + meson.build_root(), separator: ':')
56     env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
57     env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
58     test(test_name, exe, env: env, timeout: 3 * 60)
59   endif
60 endforeach