mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
tests: Use gst-validate-launcher to run python tests
This commit is contained in:
parent
af2ee3f723
commit
1ddc54ee05
3 changed files with 14 additions and 42 deletions
16
configure.ac
16
configure.ac
|
@ -179,20 +179,10 @@ if test "x$HAVE_UNISTD_H" != "xyes"; then
|
|||
GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
|
||||
fi
|
||||
|
||||
dnl *** checks for nose2 ***
|
||||
dnl *** checks for gst-validate-launcher ***
|
||||
|
||||
AC_MSG_CHECKING(for nose2)
|
||||
NOSE2=nose2
|
||||
if $NOSE2 1>&AC_FD_CC 2>&AC_FD_CC
|
||||
then
|
||||
HAVE_NOSE2=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
HAVE_NOSE2=no
|
||||
AC_MSG_RESULT(no nose2)
|
||||
fi
|
||||
AC_SUBST([NOSE2])
|
||||
AM_CONDITIONAL(HAVE_NOSE2, test "x$HAVE_NOSE2" = "xyes")
|
||||
AC_CHECK_PROG(GST_VALIDATE_LAUNCHER, gst-validate-launcher, yes)
|
||||
AM_CONDITIONAL(HAVE_GST_VALIDATE_LAUNCHER, [test "x$GST_VALIDATE_LAUNCHER" = "xyes"])
|
||||
|
||||
dnl *** checks for types/defines ***
|
||||
|
||||
|
|
|
@ -129,11 +129,11 @@ coverage-report:
|
|||
done
|
||||
|
||||
check:
|
||||
if HAVE_NOSE2
|
||||
if HAVE_GST_VALIDATE_LAUNCHER
|
||||
if WITH_PYTHON
|
||||
GI_TYPELIB_PATH=$(top_srcdir)/ges/:${GI_TYPELIB_PATH} LD_LIBRARY_PATH=$(top_srcdir)/ges/.libs:${LD_LIBRARY_PATH} ${NOSE2} --verbose -s $(top_srcdir)/tests/check/python
|
||||
GI_TYPELIB_PATH=$(top_srcdir)/ges/:${GI_TYPELIB_PATH} LD_LIBRARY_PATH=$(top_srcdir)/ges/.libs:${LD_LIBRARY_PATH} gst-validate-launcher --pyunittest-dir $(top_srcdir)/tests/check/ pyunittest --dump-on-failure
|
||||
|
||||
check-python:
|
||||
GI_TYPELIB_PATH=$(top_srcdir)/ges/:${GI_TYPELIB_PATH} LD_LIBRARY_PATH=$(top_srcdir)/ges/.libs:${LD_LIBRARY_PATH} ${NOSE2} --verbose -s $(top_srcdir)/tests/check/python
|
||||
GI_TYPELIB_PATH=$(top_srcdir)/ges/:${GI_TYPELIB_PATH} LD_LIBRARY_PATH=$(top_srcdir)/ges/.libs:${LD_LIBRARY_PATH} gst-validate-launcher --pyunittest-dir $(top_srcdir)/tests/check/ pyunittest --dump-on-failure
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -72,33 +72,15 @@ foreach t : ges_tests
|
|||
endforeach
|
||||
|
||||
if build_gir
|
||||
runtests = find_program('nose2', required : false)
|
||||
# Make sure to use the subproject gst-validate-launcher if avalaible.
|
||||
if gstvalidate_dep.found() and gstvalidate_dep.type_name() == 'internal'
|
||||
runtests = subproject('gst-devtools').get_variable('launcher')
|
||||
else
|
||||
runtests = find_program('gst-validate-launcher', required : false)
|
||||
endif
|
||||
|
||||
if runtests.found()
|
||||
testdir = '@0@/python/'.format(meson.current_source_dir())
|
||||
|
||||
tests = [
|
||||
['Test clip', 'test_clip'],
|
||||
['Test timeline', 'test_timeline'],
|
||||
['Test groups', 'test_group']
|
||||
]
|
||||
|
||||
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/')
|
||||
|
||||
args = ['--start-dir', meson.current_source_dir()]
|
||||
xunitfile = join_paths(meson.current_build_dir(), i.get(0).underscorify() + '.xunit')
|
||||
config = configuration_data()
|
||||
config.set('path', xunitfile)
|
||||
cfg = '' + i.get(0).underscorify() + '.cfg'
|
||||
configure_file(input : 'nose2-junit-xml.cfg.in', configuration : config,
|
||||
output : cfg)
|
||||
args = args + ['--plugin', 'nose2.plugins.junitxml', '--config',
|
||||
join_paths(meson.current_build_dir(), cfg)]
|
||||
|
||||
test(i.get(0), runtests, args: args + ['python.' + i.get(1)], env: env)
|
||||
endforeach
|
||||
test('pythontests', runtests, args: ['--pyunittest-dir', meson.current_source_dir(), 'pyunittest', '--dump-on-failure'],
|
||||
env: env)
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue