summaryrefslogtreecommitdiff
path: root/dev-build/steve/steve-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'dev-build/steve/steve-9999.ebuild')
-rw-r--r--dev-build/steve/steve-9999.ebuild36
1 files changed, 34 insertions, 2 deletions
diff --git a/dev-build/steve/steve-9999.ebuild b/dev-build/steve/steve-9999.ebuild
index 3b91fc9a19a5..d508d96d2a3f 100644
--- a/dev-build/steve/steve-9999.ebuild
+++ b/dev-build/steve/steve-9999.ebuild
@@ -3,7 +3,9 @@
EAPI=8
-inherit git-r3 linux-info meson systemd udev
+PYTHON_COMPAT=( python3_{11..14} )
+
+inherit git-r3 linux-info meson python-any-r1 systemd udev
DESCRIPTION="A load-balancing jobserver for Gentoo"
HOMEPAGE="https://gitweb.gentoo.org/proj/steve.git/"
@@ -11,7 +13,9 @@ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/steve.git"
LICENSE="GPL-2+"
SLOT="0"
-IUSE="debug"
+IUSE="debug test"
+RESTRICT="test"
+PROPERTIES="test? ( test_privileged )"
DEPEND="
dev-libs/libevent:=
@@ -22,21 +26,49 @@ RDEPEND="
"
BDEPEND="
virtual/pkgconfig
+ test? (
+ $(python_gen_any_dep '
+ dev-python/pytest[${PYTHON_USEDEP}]
+ dev-python/pytest-timeout[${PYTHON_USEDEP}]
+ ')
+ )
"
+python_check_deps() {
+ python_has_version "dev-python/pytest[${PYTHON_USEDEP}]" &&
+ python_has_version "dev-python/pytest-timeout[${PYTHON_USEDEP}]"
+}
+
pkg_pretend() {
local CONFIG_CHECK="~CUSE"
check_extra_config
}
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
src_configure() {
local emesonargs=(
$(meson_use !debug b_ndebug)
+ $(meson_use test)
)
meson_src_configure
}
+src_test() {
+ addwrite /dev/cuse
+ addwrite /dev/steve.test
+ if [[ ! -w /dev/cuse ]]; then
+ die "Testing steve requires /dev/cuse"
+ fi
+
+ local -x STEVE=${BUILD_DIR}/steve
+ local EPYTEST_PLUGINS=( pytest-timeout )
+ epytest
+}
+
src_install() {
meson_src_install