From a70ed336e8cce6efe9baf0ba764b5bc927b1d526 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 28 Jul 2021 10:36:09 +0200 Subject: x11-wm/herbstluftwm: improve src_test, use distutils-r1_src_test Using distutils' src_test facilities also means that we can get rid of the "export PYTHONPATH" workaround. Signed-off-by: Florian Schmaus --- x11-wm/herbstluftwm/herbstluftwm-9999.ebuild | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'x11-wm') diff --git a/x11-wm/herbstluftwm/herbstluftwm-9999.ebuild b/x11-wm/herbstluftwm/herbstluftwm-9999.ebuild index 37035a6a5ff8..ed397f906c24 100644 --- a/x11-wm/herbstluftwm/herbstluftwm-9999.ebuild +++ b/x11-wm/herbstluftwm/herbstluftwm-9999.ebuild @@ -55,6 +55,10 @@ BDEPEND=" " if [[ -n "${EGIT_REPO_URI}" ]]; then + # If hlwm is build from VCS, then hlwm-doc.json, which is used in + # the tests, needs to generated by the WITH_DOCUMENTATION option. + REQUIRED_USE+=" test? ( doc )" + # Herbstluftwm tarballs ship with pre-compiled documentation, only # if we build from git asciidoc is needed. BDEPEND+=" doc? ( app-text/asciidoc )" @@ -126,15 +130,21 @@ src_install() { distutils_enable_tests pytest -src_test() { - ln -s "${BUILD_DIR}/herbstclient" || die "Could not symlink herbstclient" - ln -s "${BUILD_DIR}/herbstluftwm" || die "Could not symlink herbstluftwm" - +python_test() { pushd python > /dev/null || die distutils_install_for_testing popd > /dev/null || die - # Ensure PYTHONPATH is exported, see https://bugs.gentoo.org/801658. - export PYTHONPATH - python_test + distutils-r1_python_test +} + +src_test() { + if [[ -n "${EGIT_REPO_URI}" ]]; then + ln -s "${BUILD_DIR}/doc/hlwm-doc.json" "doc/hlwm-doc.json" || die "Could not symlink hlwm-doc.json" + fi + + ln -s "${BUILD_DIR}/herbstclient" || die "Could not symlink herbstclient" + ln -s "${BUILD_DIR}/herbstluftwm" || die "Could not symlink herbstluftwm" + + distutils-r1_src_test } -- cgit v1.2.3-65-gdbad