sys-fs/fuse: add initial support for running tests
authorTim Harder <radhermit@gentoo.org>
Mon, 19 Mar 2018 20:51:48 +0000 (16:51 -0400)
committerTim Harder <radhermit@gentoo.org>
Mon, 19 Mar 2018 21:04:27 +0000 (17:04 -0400)
sys-fs/fuse/fuse-3.2.1.ebuild

index c60d8702e866f59875493c1de5c1b416e28ee652..ae8b104dbbaa41bca47dfffa9d48cd691a1d596d 100644 (file)
@@ -2,8 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
+PYTHON_COMPAT=( python3_{4,5,6} )
 
-inherit meson multilib-minimal flag-o-matic
+inherit meson multilib-minimal flag-o-matic python-single-r1
 
 DESCRIPTION="An interface for filesystems implemented in userspace"
 HOMEPAGE="https://github.com/libfuse/libfuse"
@@ -12,9 +13,15 @@ SRC_URI="https://github.com/libfuse/libfuse/releases/download/${P}/${P}.tar.xz"
 LICENSE="GPL-2 LGPL-2.1"
 SLOT="3"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-RESTRICT="test"
-
-DEPEND="virtual/pkgconfig"
+IUSE="test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="virtual/pkgconfig
+       test? (
+               ${PYTHON_DEPS}
+               dev-python/pytest[${PYTHON_USEDEP}]
+       )
+               "
 RDEPEND="sys-fs/fuse-common"
 
 DOCS=( AUTHORS ChangeLog.rst README.md doc/README.NFS doc/kernel.txt )
@@ -37,6 +44,10 @@ multilib_src_compile() {
        eninja
 }
 
+multilib_src_test() {
+       python3 -m pytest test || die
+}
+
 multilib_src_install() {
        DESTDIR="${D}" eninja install
 }