tests: Use gst-validate-launcher to run python tests
authorThibault Saunier <tsaunier@igalia.com>
Fri, 15 Jun 2018 20:49:55 +0000 (16:49 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Fri, 15 Jun 2018 22:09:37 +0000 (18:09 -0400)
configure.ac
tests/check/Makefile.am
tests/check/meson.build

index 3ed2a9e52e4740d9e56e5890b4742696e68eb4ae..ea89600145d7dfd1977bbefc5d1cd09016b18926 100644 (file)
@@ -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 ***
-
-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")
+dnl *** checks for gst-validate-launcher ***
+
+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 ***
 
index f0fb35b32323e9e49e5b0ff467fb9153e30895b5..40094ba207e41fba9e67438e0b8cb4732c07cacc 100644 (file)
@@ -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
index 36cce6ba327f0599687a8cc5a1e59f65a96ccd57..8e9abf176b19ff87239579455af2d59105d042fd 100644 (file)
@@ -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