4bb7de6976a654c6e073d2bc98ab1cdbcb8ebf78
[platform/upstream/gstreamer.git] / subprojects / gst-omx / tests / check / meson.build
1 # name, condition when to skip the test and extra dependencies
2 omx_tests = [
3   [ 'generic/states' ],
4 ]
5
6 test_defines = [
7   '-UG_DISABLE_ASSERT',
8   '-UG_DISABLE_CAST_CHECKS',
9   '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_PLUGIN_LOADING_WHITELIST"',
10 ]
11
12 pluginsdirs = []
13 if gst_dep.type_name() == 'pkgconfig'
14   pbase = dependency('gstreamer-plugins-base-' + api_version, required : false)
15   pluginsdirs = [gst_dep.get_variable('pluginsdir'),
16                  pbase.get_variable('pluginsdir')]
17 endif
18
19 state_ignore_elements=''
20
21 # FIXME: check, also + PTHREAD_CFLAGS
22 test_deps = [gst_dep, gstbase_dep, glib_dep, gstcheck_dep]
23
24 # FIXME: add valgrind suppression common/gst.supp gst-plugins-good.supp
25 foreach t : omx_tests
26   fname = '@0@.c'.format(t.get(0))
27   test_name = t.get(0).underscorify()
28   extra_deps = [ ]
29   if t.length() == 3
30     extra_deps = t.get(2)
31     skip_test = t.get(1)
32   elif t.length() == 2
33     skip_test = t.get(1)
34   else
35     skip_test = false
36   endif
37   if not skip_test
38     env = environment()
39     env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
40     env.set('GST_STATE_IGNORE_ELEMENTS', state_ignore_elements)
41     env.set('CK_DEFAULT_TIMEOUT', '20')
42     env.set('GST_PLUGIN_LOADING_WHITELIST', 'gstreamer', 'gst-plugins-base',
43       'gst-plugins-good', 'gst-omx@' + meson.project_build_root(), separator: ':')
44     env.set('GST_PLUGIN_PATH_1_0', [meson.global_build_root()] + pluginsdirs)
45     env.set('GSETTINGS_BACKEND', 'memory')
46     env.set('GST_OMX_CONFIG_DIR', omx_config_dir)
47
48     env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), test_name))
49     exe = executable(test_name, fname,
50       include_directories : [configinc],
51       c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines,
52       dependencies : [libm] + test_deps + extra_deps,
53     )
54     test(test_name, exe, env: env, timeout: 3 * 60)
55   endif
56 endforeach