From 1ddc54ee054bf659b05908b5d5f649bdecb551b5 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 15 Jun 2018 16:49:55 -0400 Subject: [PATCH] tests: Use gst-validate-launcher to run python tests --- configure.ac | 16 +++------------- tests/check/Makefile.am | 6 +++--- tests/check/meson.build | 34 ++++++++-------------------------- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index 3ed2a9e52e..ea89600145 100644 --- a/configure.ac +++ b/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 *** diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index f0fb35b323..40094ba207 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -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 diff --git a/tests/check/meson.build b/tests/check/meson.build index 36cce6ba32..8e9abf176b 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -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