commit:     9514728133adc545a9475adc4ac30532da777197
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed May 28 15:31:56 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 28 15:52:57 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95147281

app-text/xournalpp: wire up tests

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/xournalpp/xournalpp-1.2.5-r1.ebuild | 11 ++++++++++-
 app-text/xournalpp/xournalpp-9999.ebuild     | 14 ++++++++++++--
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/app-text/xournalpp/xournalpp-1.2.5-r1.ebuild 
b/app-text/xournalpp/xournalpp-1.2.5-r1.ebuild
index 5c831c4b3ebe..d152f47396a8 100644
--- a/app-text/xournalpp/xournalpp-1.2.5-r1.ebuild
+++ b/app-text/xournalpp/xournalpp-1.2.5-r1.ebuild
@@ -19,8 +19,9 @@ HOMEPAGE="https://github.com/xournalpp/xournalpp";
 
 LICENSE="GPL-2"
 SLOT="0"
-
+IUSE="test"
 REQUIRED_USE="${LUA_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
 
 COMMON_DEPEND="
        ${LUA_DEPS}
@@ -40,6 +41,7 @@ DEPEND="${COMMON_DEPEND}"
 BDEPEND="
        virtual/pkgconfig
        sys-apps/lsb-release
+       test? ( dev-cpp/gtest )
 "
 
 PATCHES=(
@@ -51,7 +53,14 @@ PATCHES=(
 src_configure() {
        local mycmakeargs=(
                -DLUA_VERSION="$(lua_get_version)"
+               -DENABLE_GTEST=ON
        )
 
        cmake_src_configure
 }
+
+src_test() {
+       # 
https://github.com/xournalpp/xournalpp/tree/master/test#problems-running-make-test
+       eninja -C "${BUILD_DIR}" test-units
+       cmake_src_test
+}

diff --git a/app-text/xournalpp/xournalpp-9999.ebuild 
b/app-text/xournalpp/xournalpp-9999.ebuild
index df7aa6c945ea..4c3e720a5557 100644
--- a/app-text/xournalpp/xournalpp-9999.ebuild
+++ b/app-text/xournalpp/xournalpp-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -19,8 +19,9 @@ HOMEPAGE="https://github.com/xournalpp/xournalpp";
 
 LICENSE="GPL-2"
 SLOT="0"
-
+IUSE="test"
 REQUIRED_USE="${LUA_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
 
 COMMON_DEPEND="
        ${LUA_DEPS}
@@ -33,12 +34,14 @@ COMMON_DEPEND="
        >=media-libs/libsndfile-1.0.25
        sys-libs/zlib:=
        >=x11-libs/gtk+-3.18.9:3
+       >=x11-libs/gtksourceview-4.0
 "
 RDEPEND="${COMMON_DEPEND}"
 DEPEND="${COMMON_DEPEND}"
 BDEPEND="
        virtual/pkgconfig
        sys-apps/lsb-release
+       test? ( dev-cpp/gtest )
 "
 
 PATCHES=(
@@ -50,7 +53,14 @@ PATCHES=(
 src_configure() {
        local mycmakeargs=(
                -DLUA_VERSION="$(lua_get_version)"
+               -DENABLE_GTEST=ON
        )
 
        cmake_src_configure
 }
+
+src_test() {
+       # 
https://github.com/xournalpp/xournalpp/tree/master/test#problems-running-make-test
+       eninja -C "${BUILD_DIR}" test-units
+       cmake_src_test
+}

Reply via email to