mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-13 12:51:16 +00:00
tests_: Use nose2 instead of nosetests
Differential Revision: https://phabricator.freedesktop.org/D1394
This commit is contained in:
parent
3ed09c370a
commit
d88cee856e
3 changed files with 26 additions and 22 deletions
18
configure.ac
18
configure.ac
|
@ -184,20 +184,20 @@ if test "x$HAVE_UNISTD_H" != "xyes"; then
|
|||
GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
|
||||
fi
|
||||
|
||||
dnl *** checks for nosetests ***
|
||||
dnl *** checks for nose2 ***
|
||||
|
||||
AC_MSG_CHECKING(for nosetests)
|
||||
NOSETESTS=nosetests
|
||||
if $NOSETESTS 1>&AC_FD_CC 2>&AC_FD_CC
|
||||
AC_MSG_CHECKING(for nose2)
|
||||
NOSE2=nose2
|
||||
if $NOSE2 1>&AC_FD_CC 2>&AC_FD_CC
|
||||
then
|
||||
HAVE_NOSETESTS=yes
|
||||
HAVE_NOSE2=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
HAVE_NOSETESTS=no
|
||||
AC_MSG_RESULT(no nosetests)
|
||||
HAVE_NOSE2=no
|
||||
AC_MSG_RESULT(no nose2)
|
||||
fi
|
||||
AC_SUBST([NOSETESTS])
|
||||
AM_CONDITIONAL(HAVE_NOSETESTS, test "x$HAVE_NOSETESTS" = "xyes")
|
||||
AC_SUBST([NOSE2])
|
||||
AM_CONDITIONAL(HAVE_NOSE2, test "x$HAVE_NOSE2" = "xyes")
|
||||
|
||||
dnl *** checks for types/defines ***
|
||||
|
||||
|
|
|
@ -128,11 +128,11 @@ coverage-report:
|
|||
done
|
||||
|
||||
check:
|
||||
if HAVE_NOSETESTS
|
||||
if HAVE_NOSE2
|
||||
if WITH_PYTHON
|
||||
GI_TYPELIB_PATH=$(top_srcdir)/ges/:${GI_TYPELIB_PATH} LD_LIBRARY_PATH=$(top_srcdir)/ges/.libs:${LD_LIBRARY_PATH} ${NOSETESTS} --verbose $(top_srcdir)/tests/check/python/test_*.py
|
||||
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
|
||||
|
||||
check-python:
|
||||
GI_TYPELIB_PATH=$(top_srcdir)/ges/:${GI_TYPELIB_PATH} LD_LIBRARY_PATH=$(top_srcdir)/ges/.libs:${LD_LIBRARY_PATH} ${NOSETESTS} --verbose $(top_srcdir)/tests/check/python/test_*.py
|
||||
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
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -77,27 +77,31 @@ foreach t : ges_tests
|
|||
endforeach
|
||||
|
||||
if build_gir
|
||||
runtests = find_program('nosetests3', required : false)
|
||||
# On some distros it doesn't have the '3' suffix
|
||||
if not runtests.found()
|
||||
runtests = find_program('nosetests', required : false)
|
||||
endif
|
||||
runtests = find_program('nose2', required : false)
|
||||
|
||||
if runtests.found()
|
||||
testdir = '@0@/python/'.format(meson.current_source_dir())
|
||||
|
||||
tests = [
|
||||
['Test clip', 'test_clip.py'],
|
||||
['Test timeline', 'test_timeline.py'],
|
||||
['Test groups', 'test_group.py']
|
||||
['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 = ['--with-xunit', '--xunit-file=' + meson.current_build_dir() + i.get(0).underscorify() + '.xunit']
|
||||
test(i.get(0), runtests, args: args + [testdir + '/' + i.get(1)], env: env)
|
||||
|
||||
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)
|
||||
endforeach
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue