All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Nosthoff via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Samuel Martin <s.martin49@gmail.com>
Subject: [Buildroot] [PATCH v3] package/catch2: new package
Date: Tue, 25 Oct 2022 21:01:09 +0200	[thread overview]
Message-ID: <20221025190109.320525-1-buildroot@heine.tech> (raw)

Catch2 is a modern C++ unit testing framework which is
increasing in popularity.
This package is staging only and allows to build tests
to be run on the target.

- https://github.com/catchorg/Catch2

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
--

v2:
 - fix name in Config.in comment

v3:
 - bump to version 3.1.1
 - build as static lib as shared lib is not really supported [0]
 - drop host package

[0] https://github.com/catchorg/Catch2/blob/devel/docs/faq.md
---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/catch2/Config.in   | 28 ++++++++++++++++++++++++++++
 package/catch2/catch2.hash |  3 +++
 package/catch2/catch2.mk   | 19 +++++++++++++++++++
 5 files changed, 52 insertions(+)
 create mode 100644 package/catch2/Config.in
 create mode 100644 package/catch2/catch2.hash
 create mode 100644 package/catch2/catch2.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 6e0b765ba1..7da9dc48c9 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2098,6 +2098,7 @@ F:	package/gnuplot/
 F:	package/sdl2/
 
 N:	Michael Nosthoff <buildroot@heine.tech>
+F:	package/catch2/
 F:	package/grpc/
 F:	package/gtest/
 F:	package/libabseil-cpp/
diff --git a/package/Config.in b/package/Config.in
index e3a34d6e97..9e7a68d8e9 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1968,6 +1968,7 @@ menu "Other"
 	source "package/boost/Config.in"
 	source "package/c-capnproto/Config.in"
 	source "package/capnproto/Config.in"
+	source "package/catch2/Config.in"
 	source "package/cctz/Config.in"
 	source "package/cereal/Config.in"
 	source "package/clang/Config.in"
diff --git a/package/catch2/Config.in b/package/catch2/Config.in
new file mode 100644
index 0000000000..2f53d197b2
--- /dev/null
+++ b/package/catch2/Config.in
@@ -0,0 +1,28 @@
+config BR2_PACKAGE_CATCH2
+	bool "catch2"
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14
+	depends on BR2_USE_MMU # fork()
+	help
+	  Catch2 is mainly a unit testing framework for C++, but it
+	  also provides basic micro-benchmarking features, and simple
+	  BDD macros.
+
+	  Catch2's main advantage is that using it is both simple and
+	  natural. Tests autoregister themselves and do not have to
+	  be named with valid identifiers, assertions look like
+	  normal C++ code, and sections provide a nice way to share
+	  set-up and tear-down code in tests.
+
+	  This package allows running testsuites on the target which
+	  might be advantageous in certain cases.
+
+	  https://github.com/catchorg/Catch2
+
+comment "catch2 needs a toolchain w/ C++, wchar, threads, gcc >= 4.9"
+	depends on BR2_USE_MMU
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
diff --git a/package/catch2/catch2.hash b/package/catch2/catch2.hash
new file mode 100644
index 0000000000..76f6aea150
--- /dev/null
+++ b/package/catch2/catch2.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  2106bccfec18c8ce673623d56780220e38527dd8f283ccba26aa4b8758737d0e  v3.1.1.tar.gz
+sha256  c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566  LICENSE.txt
diff --git a/package/catch2/catch2.mk b/package/catch2/catch2.mk
new file mode 100644
index 0000000000..b38f88e4da
--- /dev/null
+++ b/package/catch2/catch2.mk
@@ -0,0 +1,19 @@
+################################################################################
+#
+# catch2
+#
+################################################################################
+
+CATCH2_VERSION = 3.1.1
+CATCH2_SOURCE = v$(CATCH2_VERSION).tar.gz
+CATCH2_SITE = https://github.com/catchorg/Catch2/archive
+CATCH2_INSTALL_STAGING = YES
+CATCH2_INSTALL_TARGET = NO
+CATCH2_LICENSE = BSL-1.0
+CATCH2_LICENSE_FILES = LICENSE.txt
+CATCH2_SUPPORTS_IN_SOURCE_BUILD = NO
+
+CATCH2_CONF_OPTS = -DCATCH_INSTALL_DOCS=OFF \
+					-DBUILD_SHARED_LIBS=OFF
+
+$(eval $(cmake-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2022-10-25 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 19:01 Michael Nosthoff via buildroot [this message]
2023-02-17 15:01 ` [Buildroot] [PATCH v3] package/catch2: new package Thomas Petazzoni via buildroot

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=20221025190109.320525-1-buildroot@heine.tech \
    --to=buildroot@buildroot.org \
    --cc=buildroot@heine.tech \
    --cc=s.martin49@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.