commit:     ef65985a4e24abcc5f9049500cdad0080182436e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May 26 05:51:34 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 26 05:52:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef65985a

games-arcade/supertux: wire up tests

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

 games-arcade/supertux/supertux-0.6.3-r2.ebuild | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/games-arcade/supertux/supertux-0.6.3-r2.ebuild 
b/games-arcade/supertux/supertux-0.6.3-r2.ebuild
index cd4b63b9dd52..200786bfbfe2 100644
--- a/games-arcade/supertux/supertux-0.6.3-r2.ebuild
+++ b/games-arcade/supertux/supertux-0.6.3-r2.ebuild
@@ -17,7 +17,8 @@ S="${WORKDIR}/${MY_P}"
 LICENSE="GPL-2+ GPL-3+ ZLIB MIT CC-BY-SA-2.0 CC-BY-SA-3.0"
 SLOT="0"
 KEYWORDS="~amd64 ~arm64 ~x86"
-IUSE="debug"
+IUSE="debug test"
+RESTRICT="!test? ( test )"
 
 # =media-libs/libsdl2-2.0.14-r0 can cause supertux binary to move entire
 # content of ${HOME} to ${HOME}/.local/share/supertux2/
@@ -40,6 +41,7 @@ DEPEND="${RDEPEND}
        media-libs/glm"
 BDEPEND="
        virtual/pkgconfig
+       test? ( dev-cpp/gtest )
 "
 
 PATCHES=(
@@ -60,6 +62,13 @@ src_configure() {
                -DENABLE_SQDBG="$(usex debug)"
                -DUSE_SYSTEM_PHYSFS=ON
                -DIS_SUPERTUX_RELEASE=ON
+               -DBUILD_TESTS="$(usex test)"
        )
        cmake_src_configure
 }
+
+src_test() {
+       # Assumes in-source build to find test data
+       local -x GTEST_FILTER="-IFileStreamTest.test"
+       cmake_src_test
+}

Reply via email to