2016-08-04 21:33:55 +00:00
|
|
|
# tests and condition when to skip the test
|
|
|
|
ges_tests = [
|
|
|
|
['ges/asset'],
|
|
|
|
['ges/backgroundsource'],
|
|
|
|
['ges/basic'],
|
|
|
|
['ges/layer'],
|
|
|
|
['ges/effects'],
|
|
|
|
['ges/uriclip'],
|
|
|
|
['ges/clip'],
|
|
|
|
['ges/timelineedition'],
|
|
|
|
['ges/titles'],
|
|
|
|
['ges/transition'],
|
|
|
|
['ges/overlays'],
|
|
|
|
['ges/text_properties'],
|
|
|
|
['ges/mixers'],
|
|
|
|
['ges/group'],
|
|
|
|
['ges/project'],
|
|
|
|
['ges/track'],
|
|
|
|
['ges/tempochange'],
|
|
|
|
['nle/simple'],
|
|
|
|
['nle/complex'],
|
|
|
|
['nle/nleoperation'],
|
|
|
|
['nle/nlecomposition'],
|
|
|
|
['nle/tempochange']
|
|
|
|
]
|
|
|
|
|
|
|
|
test_defines = [
|
|
|
|
'-UG_DISABLE_ASSERT',
|
|
|
|
'-UG_DISABLE_CAST_CHECKS',
|
2016-09-09 19:42:13 +00:00
|
|
|
'-DGES_TEST_FILES_PATH="' + meson.current_source_dir() + '/ges/"',
|
2016-08-04 21:33:55 +00:00
|
|
|
'-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
|
|
|
|
'-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
|
|
|
|
'-DGST_USE_UNSTABLE_API',
|
|
|
|
]
|
|
|
|
|
2016-10-03 20:44:04 +00:00
|
|
|
pluginsdirs = []
|
|
|
|
if not meson.is_subproject()
|
|
|
|
pkgconfig = find_program('pkg-config')
|
|
|
|
runcmd = run_command(pkgconfig, '--variable=pluginsdir',
|
|
|
|
'gstreamer-' + apiversion, 'gstreamer-plugins-base-' + apiversion,
|
|
|
|
'gstreamer-plugins-bad-' + apiversion)
|
2016-08-04 21:33:55 +00:00
|
|
|
|
2016-10-03 20:44:04 +00:00
|
|
|
if runcmd.returncode() == 0
|
|
|
|
pluginsdirs = runcmd.stdout().split()
|
|
|
|
else
|
|
|
|
error('Could not determine GStreamer core plugins directory for unit tests.')
|
|
|
|
endif
|
|
|
|
endif
|
2016-08-04 21:33:55 +00:00
|
|
|
|
|
|
|
foreach t : ges_tests
|
|
|
|
test_name = t.get(0)
|
|
|
|
if t.length() == 2
|
|
|
|
skip_test = t.get(1)
|
|
|
|
else
|
|
|
|
skip_test = false
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not skip_test
|
2016-10-03 20:44:04 +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))
|
|
|
|
foreach plugindir: pluginsdirs
|
|
|
|
env.append('GST_PLUGIN_PATH_1_0', plugindir)
|
|
|
|
endforeach
|
|
|
|
|
2016-08-04 21:33:55 +00:00
|
|
|
exe = executable(test_name, '@0@.c'.format(test_name),
|
|
|
|
'ges/test-utils.c', 'nle/common.c',
|
|
|
|
c_args : ges_c_args + test_defines,
|
|
|
|
include_directories : [configinc],
|
|
|
|
dependencies : libges_deps + [gstcheck_dep, ges_dep],
|
|
|
|
)
|
2016-10-03 20:44:04 +00:00
|
|
|
test(test_name, exe, env: env)
|
2016-08-04 21:33:55 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
2016-09-13 15:31:54 +00:00
|
|
|
|
|
|
|
if build_gir
|
2016-10-19 14:34:56 +00:00
|
|
|
runtests = find_program('nose2', required : false)
|
2016-09-13 15:31:54 +00:00
|
|
|
|
|
|
|
if runtests.found()
|
|
|
|
testdir = '@0@/python/'.format(meson.current_source_dir())
|
|
|
|
|
|
|
|
tests = [
|
2016-10-19 14:34:56 +00:00
|
|
|
['Test clip', 'test_clip'],
|
|
|
|
['Test timeline', 'test_timeline'],
|
|
|
|
['Test groups', 'test_group']
|
2016-09-13 15:31:54 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach i: tests
|
|
|
|
env = environment()
|
|
|
|
env.prepend('GI_TYPELIB_PATH', meson.current_build_dir() + '/../../ges/')
|
|
|
|
env.prepend('LD_LIBRARY_PATH', meson.current_build_dir() + '/../../ges/')
|
2016-10-19 14:34:56 +00:00
|
|
|
|
|
|
|
args = ['--project-directory', meson.current_source_dir() + '/../..',
|
|
|
|
'--start-dir', meson.current_source_dir()]
|
|
|
|
xunitfile = '' + i.get(0).underscorify() + '.xunit'
|
|
|
|
config = configuration_data()
|
|
|
|
config.set('path', xunitfile)
|
|
|
|
configure_file(input : 'nose2-junit-xml.cfg.in', configuration : config, output : xunitfile + '.cfg')
|
|
|
|
args = args + ['--plugin', 'nose2.plugins.junitxml', '--config', meson.current_build_dir() + '/' + xunitfile + '.cfg']
|
|
|
|
|
|
|
|
test(i.get(0), runtests, args: args + ['python.' + i.get(1)], env: env)
|
2016-09-13 15:31:54 +00:00
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
endif
|