From 338867d01cf362679cbed37e93ed2527664a9104 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 12 Jul 2024 00:23:12 -0700 Subject: gnu: Add bash-unit. * gnu/packages/bash.scm (bash-unit): New variable. Change-Id: Ic4185a2364922b03efe7f528e474ac9e71cbf66c Signed-off-by: Greg Hogan --- gnu/packages/bash.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index ef530522ec..f45c0982f1 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2021 Marius Bakke ;;; Copyright © 2024 Oleg Pykhalov ;;; Copyright © 2024 Janneke Nieuwenhuizen +;;; Copyright © 2024 chris ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,6 +50,7 @@ (define-module (gnu packages bash) #:use-module (guix gexp) #:use-module (guix monads) #:use-module (guix store) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:autoload (guix gnupg) (gnupg-verify*) @@ -525,3 +527,33 @@ (define-public blesh which replaces the default GNU Readline. It adds syntax highlighting, auto suggestions, vim modes, and more to Bash interactive sessions.") (license license:bsd-3))) + +(define-public bash-unit + (package + (name "bash-unit") + (version "2.3.2") + (home-page "https://github.com/pgrange/bash_unit") + (source + (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1gb6vfr5m84bn1gbv7w3jr06fspylj1i3yqkvgxq0n3bncvs35wz")))) + (build-system copy-build-system) + (arguments + `(#:install-plan '(("bash_unit" "bin/")) + #:phases (modify-phases %standard-phases + (add-before 'install 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "./bash_unit" "tests/test_core.sh"))))))) + (inputs (list bash-minimal)) + (synopsis "Bash unit testing framework") + (description + "@command{bash_unit} allows you to write unit tests, run them and, in case +of failure, display the stack trace with source file and line number indications +to locate the problem.") + (license license:gpl3+))) -- cgit v1.2.3