guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: Add bats.


From: guix-commits
Subject: branch master updated: gnu: Add bats.
Date: Mon, 29 Jun 2020 03:40:42 -0400

This is an automated email from the git hooks/post-receive script.

wigust pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 5a88d3d  gnu: Add bats.
5a88d3d is described below

commit 5a88d3dfcb382a9256e5b6d18f1487b597260944
Author: Oleg Pykhalov <go.wigust@gmail.com>
AuthorDate: Sun Jun 7 20:58:27 2020 +0300

    gnu: Add bats.
    
    * gnu/packages/bash.scm (bats): New variable.
---
 gnu/packages/bash.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 3ba8a13..b331676 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -24,11 +24,13 @@
 (define-module (gnu packages bash)
   #:use-module (guix licenses)
   #:use-module (gnu packages)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bootstrap)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages guile)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -37,6 +39,7 @@
   #:use-module (guix monads)
   #:use-module (guix store)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:autoload   (guix gnupg) (gnupg-verify*)
   #:autoload   (guix base32) (bytevector->nix-base32-string)
 
@@ -362,3 +365,52 @@ for Bash shell scripts and functions.  Along with the 
Test::More-style testing
 helpers it provides helper functions for mocking commands and in-process output
 capturing.")
     (license expat)))
+
+(define-public bats
+  (package
+    (name "bats")
+    (version "1.2.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/bats-core/bats-core.git";)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0f59zh4d4pa1a7ybs5zl6h0csbqqv11lbnq0jl1dgwm1s6p49bsq"))))
+    (inputs
+     `(("bash" ,bash)
+       ("coreutils" ,coreutils)
+       ("guile" ,guile-3.0) ;for wrap-script
+       ("grep" ,grep)))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (copy-recursively (assoc-ref %build-inputs "source") ".")
+         (setenv "PATH"
+                 (string-append (assoc-ref %build-inputs "bash") "/bin"
+                                ":" (assoc-ref %build-inputs "coreutils") 
"/bin"
+                                ":" (assoc-ref %build-inputs "grep") "/bin"
+                                ":" (assoc-ref %build-inputs "guile") "/bin"
+                                ":" (getenv "PATH")))
+         (for-each (lambda (file) (patch-shebang file)) (find-files "."))
+         (substitute* "bin/bats"
+           (("export BATS_ROOT" line)
+            (string-append "BATS_ROOT=\"${BATS_ROOT:-" %output 
"/libexec/bats-core}\"\n"
+                           line)))
+         ;; Install phase
+         (invoke "./install.sh" %output)
+         (wrap-script (string-append %output "/bin/bats")
+                      (list "PATH" 'prefix (string-split (getenv "PATH")
+                                                         #\:))))))
+    (build-system trivial-build-system)
+    (home-page "https://github.com/bats-core/bats-core/";)
+    (synopsis "Bash Automated Testing System")
+    (description "Bats is a TAP-compliant testing framework for Bash.  It
+provides a simple way to verify that the UNIX programs you write behave as
+expected.  Bats is most useful when testing software written in Bash, but you
+can use it to test any UNIX program.")
+    (license expat)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]