media-video/mpv: enable test support, masked on ~alpha for now
authorIlya Tumaykin <itumaykin@gmail.com>
Tue, 22 Dec 2015 16:44:10 +0000 (19:44 +0300)
committerIlya Tumaykin <itumaykin@gmail.com>
Mon, 28 Dec 2015 12:47:08 +0000 (15:47 +0300)
mpv has a small, but working test suite. It requires dev-util/cmocka,
which is missing ~alpha keyword atm. Thus a package USE mask is needed.

See bug 569558 for dev-util/cmocka KEYWORDREQ.

Package-Manager: portage-2.2.24

media-video/mpv/mpv-9999.ebuild

index 2b35da3807846966e7cf62a03a95a82c160d7eaa..2c4646311ef0caa2928ac3b03bfb03c33cf80444 100644 (file)
@@ -29,8 +29,8 @@ DOCS+=( README.md etc/example.conf etc/input.conf )
 LICENSE="GPL-2+ BSD ISC"
 SLOT="0"
 IUSE="+alsa archive bluray cdda +cli doc drm dvb +dvd egl +enca encode +iconv
-jack jpeg lcms +libass libav libcaca libguess libmpv lua luajit openal
-+opengl oss pulseaudio pvr raspberry-pi rubberband samba sdl selinux v4l vaapi
+jack jpeg lcms +libass libav libcaca libguess libmpv lua luajit openal +opengl
+oss pulseaudio pvr raspberry-pi rubberband samba sdl selinux test v4l vaapi
 vdpau vf-dlopen wayland +X xinerama +xscreensaver xv"
 
 REQUIRED_USE="
@@ -111,6 +111,7 @@ DEPEND="${COMMON_DEPEND}
        dev-python/docutils
        virtual/pkgconfig
        doc? ( dev-python/rst2pdf )
+       test? ( >=dev-util/cmocka-1.0.0 )
 "
 RDEPEND="${COMMON_DEPEND}
        selinux? ( sec-policy/selinux-mplayer )
@@ -163,11 +164,11 @@ src_configure() {
                --disable-build-date    # keep build reproducible
                --disable-optimize      # do not add '-O2' to CFLAGS
                --disable-debug-build   # do not add '-g' to CFLAGS
-               --disable-test          # avoid dev-util/cmocka automagic
 
                $(use_enable doc pdf-build)
                $(use_enable vf-dlopen vf-dlopen-filters)
                $(use_enable cli zsh-comp)
+               $(use_enable test)
 
                # optional features
                $(use_enable iconv)
@@ -257,3 +258,12 @@ pkg_postrm() {
        fdo-mime_desktop_database_update
        gnome2_icon_cache_update
 }
+
+src_test() {
+       cd "${S}"/build/test || die
+       for test in *; do
+               if [[ -x ${test} ]]; then
+                       ./"${test}" || die "Test suite failed"
+               fi
+       done
+}