dev-build/steve: Enable tests

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2025-12-13 17:49:42 +01:00
parent 0de7a86c63
commit 3a237bc07e

View File

@@ -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