Explorar o código

package/catch2: new package

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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Michael Nosthoff %!s(int64=2) %!d(string=hai) anos
pai
achega
c5b597d5d8
Modificáronse 5 ficheiros con 55 adicións e 0 borrados
  1. 1 0
      DEVELOPERS
  2. 1 0
      package/Config.in
  3. 28 0
      package/catch2/Config.in
  4. 3 0
      package/catch2/catch2.hash
  5. 22 0
      package/catch2/catch2.mk

+ 1 - 0
DEVELOPERS

@@ -2035,6 +2035,7 @@ F:	package/sdl2/
 
 N:	Michael Nosthoff <buildroot@heine.tech>
 F:	package/boost/
+F:	package/catch2/
 F:	package/fmt/
 F:	package/grpc/
 F:	package/gtest/

+ 1 - 0
package/Config.in

@@ -2012,6 +2012,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"

+ 28 - 0
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

+ 3 - 0
package/catch2/catch2.hash

@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  2106bccfec18c8ce673623d56780220e38527dd8f283ccba26aa4b8758737d0e  catch2-3.1.1.tar.gz
+sha256  c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566  LICENSE.txt

+ 22 - 0
package/catch2/catch2.mk

@@ -0,0 +1,22 @@
+################################################################################
+#
+# catch2
+#
+################################################################################
+
+CATCH2_VERSION = 3.1.1
+CATCH2_SITE = $(call github,catchorg,Catch2,v$(CATCH2_VERSION))
+CATCH2_INSTALL_STAGING = YES
+CATCH2_INSTALL_TARGET = NO
+CATCH2_LICENSE = BSL-1.0
+CATCH2_LICENSE_FILES = LICENSE.txt
+CATCH2_SUPPORTS_IN_SOURCE_BUILD = NO
+
+# We force building a static library only as building a dynamic
+# library is not really supported officially:
+# https://github.com/catchorg/Catch2/blob/devel/docs/faq.md#can-i-compile-catch2-into-a-dynamic-library
+CATCH2_CONF_OPTS = \
+	-DCATCH_INSTALL_DOCS=OFF \
+	-DBUILD_SHARED_LIBS=OFF
+
+$(eval $(cmake-package))