commit:     a70ed336e8cce6efe9baf0ba764b5bc927b1d526
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 28 08:36:09 2021 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Wed Jul 28 08:37:30 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a70ed336

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 <flow <AT> gentoo.org>

 x11-wm/herbstluftwm/herbstluftwm-9999.ebuild | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/x11-wm/herbstluftwm/herbstluftwm-9999.ebuild 
b/x11-wm/herbstluftwm/herbstluftwm-9999.ebuild
index 37035a6a5ff..ed397f906c2 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
 }

Reply via email to