summaryrefslogtreecommitdiff
path: root/gnu/packages/check.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r--gnu/packages/check.scm150
1 files changed, 86 insertions, 64 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..85eeac98a4 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -38,11 +38,12 @@
;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
-;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net>
;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
+;;; Copyright © 2023 Zhu Zihao <all_but_last@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -596,10 +597,10 @@ It allows the specification of behaviour scenarios using a given-when-then
pattern.")
(license license:apsl2))))
-(define-public catch2-3.1
+(define-public catch2-3.3
(package
(name "catch2")
- (version "3.1.1")
+ (version "3.3.2")
(home-page "https://github.com/catchorg/Catch2")
(source (origin
(method git-fetch)
@@ -609,66 +610,14 @@ pattern.")
(file-name (git-file-name name version))
(sha256
(base32
- "1qnr5b3zq8brh43f924rgnw5gmmjf9ax7kbq2crz1mlwgmdymxlp"))))
- (outputs (list "out" "static"))
- (build-system meson-build-system)
+ "0m6i3lr0qk303ashjpz5vpwmxf76n5d6s8jq6r6kcy6gph525zmp"))))
+ (build-system cmake-build-system)
(arguments
(list
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'unpack 'patch-meson
- (lambda _
- (substitute* "src/catch2/meson.build"
- (("static_library") "both_libraries"))))
- (add-after 'install 'install-cmake-config
- (lambda* (#:key outputs #:allow-other-keys)
- (define prefix (string-append (assoc-ref outputs "out")
- "/lib/cmake/Catch2/"))
- (mkdir-p prefix)
- (call-with-output-file (string-append
- prefix
- "catch2-config-version.cmake")
- (lambda (port)
- (format
- port
- "set(PACKAGE_VERSION ~s)~@
- if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)~@
- set(PACKAGE_VERSION_EXACT TRUE)~@
- set(PACKAGE_VERSION_COMPATIBLE TRUE)~@
- elseif(PACKAGE_FIND_VERSION VERSION_LESS_EQUAL ~
- PACKAGE_VERSION)~@
- set(PACKAGE_VERSION_COMPATIBLE TRUE)~@
- else()~@
- set(PACKAGE_VERSION_COMPATIBLE FALSE)~@
- endif()"
- #$version)))
- (call-with-output-file (string-append prefix
- "catch2-config.cmake")
- (lambda (port)
- (format
- port
- "include(FindPkgConfig)~@
- pkg_check_modules(CATCH2 IMPORTED_TARGET GLOBAL catch2)~@
- pkg_check_modules(CATCH2MAIN ~
- IMPORTED_TARGET GLOBAL ~
- catch2 catch2-with-main)~@
- if(CATCH2_FOUND)~@
- add_library(Catch2::Catch2 ALIAS PkgConfig::CATCH2)~@
- endif()~@
- if(CATCH2MAIN_FOUND)~@
- add_library(Catch2::Catch2WithMain ~
- ALIAS PkgConfig::CATCH2MAIN)~@
- endif()")))))
- (add-after 'install 'move-static-libraries
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (static (assoc-ref outputs "static")))
- (for-each
- (lambda (file)
- (install-file file (string-append static "/lib"))
- (delete-file file))
- (find-files (string-append out "/lib")
- "\\.a$"))))))))
+ #:configure-flags
+ #~(list "-DCATCH_DEVELOPMENT_BUILD=ON"
+ "-DCATCH_ENABLE_WERROR=OFF"
+ "-DBUILD_SHARED_LIBS=ON")))
(inputs (list python-wrapper))
(synopsis "Automated test framework for C++ and Objective-C")
(description "Catch2 stands for C++ Automated Test Cases in Headers and is
@@ -2386,9 +2335,9 @@ failures.")
(package/inherit python-pytest-enabler-bootstrap
(arguments
(substitute-keyword-arguments
- (package-arguments python-pytest-enabler-bootstrap)
- ((#:tests? _ #f)
- #t)
+ (strip-keyword-arguments
+ '(#:tests?)
+ (package-arguments python-pytest-enabler-bootstrap))
((#:phases phases #~%standard-phases)
#~(modify-phases #$phases
(replace 'check
@@ -3198,6 +3147,46 @@ application \"sees\". It is meant to be loaded using the dynamic linker's
provides a simple way to achieve this.")
(license license:gpl2)))
+(define-public rapidcheck
+ (let ((commit "a5724ea5b0b00147109b0605c377f1e54c353ba2")
+ (revision "0"))
+ (package
+ (name "rapidcheck")
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/emil-e/rapidcheck")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0f2dmsym8ibnwkaidxmgp73mg0sdniwsyn6ppskh74246h29bbcy"))))
+ (arguments
+ (list
+ #:tests? #f ;require fetching submodules
+ #:configure-flags #~(list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'install-extra-headers
+ (lambda _
+ (with-directory-excursion "../source/extras"
+ (for-each
+ (lambda (dir)
+ (let ((dir (string-append dir "/include/rapidcheck/"))
+ (dest (string-append #$output
+ "/include/rapidcheck")))
+ (copy-recursively dir dest)))
+ '("boost" "boost_test" "catch" "gmock" "gtest"))))))))
+ (build-system cmake-build-system)
+ (home-page "https://github.com/emil-e/rapidcheck")
+ (synopsis "Property based testing framework for C++")
+ (description "Rapidcheck is a property based testing framework for C++.
+It works by generating random data to try and find a case breaks your given
+pre-condition.")
+ (license license:bsd-2))))
+
(define-public umockdev
(package
(name "umockdev")
@@ -3554,3 +3543,36 @@ with SRFI 64-based test suites. It comes with a command-line interface
to run test collections, and a library that includes a test runner and
helpers for writing tests.")
(license license:public-domain)))
+
+(define-public subunit
+ (package
+ (name "subunit")
+ (version "1.4.2")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/testing-cabal/subunit")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16n1zxwnmhb7vzixngvmm5zzk4q5jaqqjwyr6pr6w0ys60b7xja3"))))
+ (build-system gnu-build-system)
+ (native-inputs (list autoconf
+ automake
+ check
+ cppunit
+ libtool
+ pkg-config
+ python-fixtures
+ python-hypothesis
+ python-testscenarios))
+ (inputs (list perl python))
+ (propagated-inputs (list python-testtools))
+ (home-page "https://github.com/testing-cabal/subunit")
+ (synopsis "Test reporting and control protocol")
+ (description
+ "Subunit is a streaming protocol for test results. Subunit comes with
+command line filters to process a subunit stream and language bindings for
+Python, C, C++ and shell. Bindings are easy to write for other languages.")
+ (license (list license:asl2.0 license:bsd-3)))) ;user can pick