From: "Lucio Sauer" <watermanpaint@posteo.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-cpp/mustache/, dev-cpp/mustache/files/
Date: Sat, 22 Jun 2024 23:51:41 +0000 (UTC) [thread overview]
Message-ID: <1719100249.8b17e78ebd7732d76fb4a4f38097b1d6f514f75d.watermanpaint@gentoo> (raw)
commit: 8b17e78ebd7732d76fb4a4f38097b1d6f514f75d
Author: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Sat Jun 22 23:50:49 2024 +0000
Commit: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Sat Jun 22 23:50:49 2024 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8b17e78e
dev-cpp/mustache: unbundle test dependency
Make test compilation optional.
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
.../mustache-4.1_p20211210-unbundle-catch.patch | 48 ++++++++++++++++++++++
dev-cpp/mustache/mustache-4.1_p20211210.ebuild | 13 ++++++
2 files changed, 61 insertions(+)
diff --git a/dev-cpp/mustache/files/mustache-4.1_p20211210-unbundle-catch.patch b/dev-cpp/mustache/files/mustache-4.1_p20211210-unbundle-catch.patch
new file mode 100644
index 000000000..bb68eb4c1
--- /dev/null
+++ b/dev-cpp/mustache/files/mustache-4.1_p20211210-unbundle-catch.patch
@@ -0,0 +1,48 @@
+Unbundle test dependency dev-cpp/catch and make test compilation optional.
+
+Author: Lucio Sauer <watermanpaint@posteo.net>
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,7 +2,12 @@ cmake_minimum_required(VERSION 3.0.2)
+ project(mustache)
+ add_library(mustache INTERFACE)
+
++option(TESTS "build tests")
++
+ target_compile_features(mustache INTERFACE cxx_std_17)
+ target_sources(mustache INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/mustache.hpp)
+ target_include_directories(mustache INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+-add_subdirectory(tests)
+\ No newline at end of file
++
++if (TESTS)
++ add_subdirectory(tests)
++endif (TESTS)
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,10 +1,12 @@
++find_package(Catch2 REQUIRED)
++
+ add_executable(mustache-unit-tests
+ ../mustache.hpp # to show in IDE
+- catch.hpp # to show in IDE
+ tests.cpp
+ )
+
+-target_link_libraries(mustache-unit-tests PRIVATE mustache)
++
++target_link_libraries(mustache-unit-tests PRIVATE mustache Catch2::Catch2)
+
+ if (UNIX)
+ target_compile_options(mustache-unit-tests PRIVATE -Wall -Wextra -Werror -Wconversion)
+--- a/tests/tests.cpp
++++ b/tests/tests.cpp
+@@ -29,7 +29,7 @@
+ #include "mustache.hpp"
+
+ #define CATCH_CONFIG_MAIN
+-#include "catch.hpp"
++#include <catch2/catch.hpp>
+
+ using namespace kainjow::mustache;
+
diff --git a/dev-cpp/mustache/mustache-4.1_p20211210.ebuild b/dev-cpp/mustache/mustache-4.1_p20211210.ebuild
index ee71cb14a..6739909f5 100644
--- a/dev-cpp/mustache/mustache-4.1_p20211210.ebuild
+++ b/dev-cpp/mustache/mustache-4.1_p20211210.ebuild
@@ -14,6 +14,19 @@ S="${WORKDIR}/Mustache-${COMMIT}"
LICENSE="Boost-1.0"
SLOT="0"
KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="test? ( <dev-cpp/catch-3 )"
+
+PATCHES="${FILESDIR}"/${P}-unbundle-catch.patch
+
+src_configure() {
+ local mycmakeargs=(
+ -DTESTS=$(usex test)
+ )
+ cmake_src_configure
+}
src_test() {
"${BUILD_DIR}"/tests/mustache-unit-tests || die "Tests failed!"
reply other threads:[~2024-06-22 23:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1719100249.8b17e78ebd7732d76fb4a4f38097b1d6f514f75d.watermanpaint@gentoo \
--to=watermanpaint@posteo.net \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox