diff mbox series

[bug#64255,1/2] gnu: Add ftest.

Message ID 3984f2b4285c7f0a688096f3bd2771b10f898db1.1687527788.git.hako@ultrarare.space
State New
Headers show
Series gnu: utfcpp: Update to 3.2.3 | expand

Commit Message

Hilton Chain June 23, 2023, 3:35 p.m. UTC
From: Reza Housseini <reza@housseini.me>

* gnu/packages/check.scm (ftest): New variable.

Co-authored-by: Hilton Chain <hako@ultrarare.space>
---
 gnu/packages/check.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 87728fefa3..0aa519ad67 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -43,6 +43,8 @@ 
 ;;; 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 Reza Housseini <reza@housseini.me>
+;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -65,6 +67,7 @@  (define-module (gnu packages check)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -92,6 +95,7 @@  (define-module (gnu packages check)
   #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
@@ -863,6 +867,43 @@  (define-public doctest
 has been designed to be fast, light and unintrusive.")
     (license license:expat)))
 
+(define-public ftest
+  ;; There aren't any releases and it looks more like a small side project.
+  ;; It is included for completness to run tests for package utfcpp.
+  (let ((commit "c4ad4af0946b73ce1a40cbc72205d15d196c7e06")
+        (revision "0"))
+    (package
+      (name "ftest")
+      (version (git-version "0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/nemtrif/ftest")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1jcd76zjhx5f2nsi80hj7gmywgpz1f7vcw8lv5yf7gx0l99dn86x"))))
+      ;; No CMakeLists.txt file provided, only one to run tests
+      (build-system copy-build-system)
+      (arguments
+       (list #:install-plan
+             #~'(("ftest.h" "include/ftest/"))
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-before 'install 'check
+                   (lambda _
+                     (with-directory-excursion "tests"
+                       (invoke "cmake" ".")
+                       (invoke "make")
+                       (invoke "ctest")))))))
+      (native-inputs (list cmake-minimal))
+      (home-page "https://github.com/nemtrif/ftest")
+      (synopsis "C++ testing framework")
+      (description
+       "This package provides a simple and limited unit-test framework for C++.")
+      (license license:boost1.0))))
+
 (define-public go-github.com-smartystreets-gunit
   (package
     (name "go-github.com-smartystreets-gunit")