From d88cee856e78ba2e4c6e075a59af43369b53423a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandru=20B=C4=83lu=C8=9B?= Date: Wed, 19 Oct 2016 16:34:56 +0200 Subject: [PATCH] tests_: Use nose2 instead of nosetests Differential Revision: https://phabricator.freedesktop.org/D1394 --- configure.ac | 18 +++++++++--------- tests/check/Makefile.am | 6 +++--- tests/check/meson.build | 24 ++++++++++++++---------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index df3b1a34b8..8bdb185ab7 100644 --- a/configure.ac +++ b/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 *** diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index fbc7be6b27..a3c7d06408 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -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 diff --git a/tests/check/meson.build b/tests/check/meson.build index e2625e4692..aa7644f3eb 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -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