From 3a237bc07e769fd4792e154aa6a4a9a1a652edf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 13 Dec 2025 17:49:42 +0100 Subject: [PATCH] dev-build/steve: Enable tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- dev-build/steve/steve-9999.ebuild | 36 +++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/dev-build/steve/steve-9999.ebuild b/dev-build/steve/steve-9999.ebuild index 3b91fc9a19a52..d508d96d2a3f1 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