unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#33738] Add emacs-buttercup
@ 2018-12-14  7:01 Arun Isaac
  2018-12-16 15:09 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Isaac @ 2018-12-14  7:01 UTC (permalink / raw)
  To: 33738

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]


This patchset adds emacs-buttercup, and enables tests for emacs-circe
and emacs-tracking, two packages that require emacs-buttercup to run
tests.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-emacs-buttercup.patch --]
[-- Type: text/x-patch, Size: 2159 bytes --]

From c3640218f58363c645afec59d402cd4b73a9a448 Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Wed, 12 Dec 2018 00:47:01 +0530
Subject: [PATCH 1/3] gnu: Add emacs-buttercup.

* gnu/packages/emacs.scm (emacs-buttercup): New variable.
---
 gnu/packages/emacs.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 358f32cab..74a9bb79d 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -12757,3 +12757,36 @@ interactive session association with the current contexts (project, directory,
 buffers).  While sesman can be used to manage arbitrary sessions, it primary
 targets the Emacs based IDEs (CIDER, ESS, Geiser, Robe, SLIME etc.)")
     (license license:gpl3+)))
+
+(define-public emacs-buttercup
+  (package
+    (name "emacs-buttercup")
+    (version "1.16")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/jorgenschaefer/emacs-buttercup.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0dckgcyzsav6ld78bcyrrygy1cz1jvqgav6vy8f6klpmk3r8xrl1"))))
+    (build-system emacs-build-system)
+    (arguments
+     `(#:tests? #t
+       #:test-command '("make" "test")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-bin
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "bin/buttercup"
+                           (string-append (assoc-ref outputs "out") "/bin"))
+             #t)))))
+    (home-page "https://github.com/jorgenschaefer/emacs-buttercup")
+    (synopsis "Behavior driven emacs lisp testing framework")
+    (description "Buttercup is a behavior-driven development framework for
+testing Emacs Lisp code.  It allows to group related tests so they can share
+common set-up and tear-down code, and allows the programmer to \"spy\" on
+functions to ensure they are called with the right arguments during testing.")
+    (license license:gpl3+)))
-- 
2.19.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-emacs-circe-Enable-tests.patch --]
[-- Type: text/x-patch, Size: 1353 bytes --]

From 75553dd0bd5e7e0549aa003f006b719f5502b1cb Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Wed, 12 Dec 2018 00:59:15 +0530
Subject: [PATCH 2/3] gnu: emacs-circe: Enable tests.

* gnu/packages/emacs.scm (emacs-circe)[arguments]: Enable tests. Set
test-command. Add set-home phase.
[native-inputs]: Add emacs-buttercup.
---
 gnu/packages/emacs.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 74a9bb79d..0575338ee 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -7835,6 +7835,19 @@ value of the access token.")
         (base32
          "10gi14kwxd81blddpvqh95lgmpbfgp0m955naxix3bs3r6a75n4s"))))
     (build-system emacs-build-system)
+    (arguments
+     `(#:tests? #t
+       #:test-command '("buttercup" "-L" ".")
+       #:phases
+       (modify-phases %standard-phases
+         ;; The HOME environment variable should be set to an existing
+         ;; directory for the tests to succeed.
+         (add-before 'check 'set-home
+           (lambda _
+             (setenv "HOME" "/tmp")
+             #t)))))
+    (native-inputs
+     `(("emacs-buttercup" ,emacs-buttercup)))
     ;; In order to securely connect to an IRC server using TLS, Circe requires
     ;; the GnuTLS binary.
     (propagated-inputs
-- 
2.19.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-emacs-tracking-Enable-tests.patch --]
[-- Type: text/x-patch, Size: 1086 bytes --]

From e17724b3e59a7784aac391e5be7e450ffcf2a67d Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Wed, 12 Dec 2018 01:00:26 +0530
Subject: [PATCH 3/3] gnu: emacs-tracking: Enable tests.

* gnu/packages/emacs.scm (emacs-tracking)[arguments]: Append to arguments
inherited from emacs-circe, instead of overwriting them.
---
 gnu/packages/emacs.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 0575338ee..df56612c3 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -7868,7 +7868,7 @@ want to use it.")
      ;; "tracking.el" is a library extracted from Circe package.  It requires
      ;; "shorten.el".
      `(#:include '("^shorten.el$" "^tracking.el$")
-       #:tests? #f))                    ;tests require buttercup
+       ,@(package-arguments emacs-circe)))
     (home-page "https://github.com/jorgenschaefer/circe/wiki/Tracking")
     (synopsis "Buffer tracking library")
     (description "@code{tracking.el} provides a way for different modes to
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#33738] Add emacs-buttercup
  2018-12-14  7:01 [bug#33738] Add emacs-buttercup Arun Isaac
@ 2018-12-16 15:09 ` Ludovic Courtès
  2018-12-16 18:28   ` bug#33738: " Arun Isaac
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2018-12-16 15:09 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 33738

Hello Arun,

Arun Isaac <arunisaac@systemreboot.net> skribis:

> This patchset adds emacs-buttercup, and enables tests for emacs-circe
> and emacs-tracking, two packages that require emacs-buttercup to run
> tests.

All 3 patches LGTM, thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33738: Add emacs-buttercup
  2018-12-16 15:09 ` Ludovic Courtès
@ 2018-12-16 18:28   ` Arun Isaac
  0 siblings, 0 replies; 3+ messages in thread
From: Arun Isaac @ 2018-12-16 18:28 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 33738-done


> All 3 patches LGTM, thank you!

Pushed to master, thanks for the review!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-16 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14  7:01 [bug#33738] Add emacs-buttercup Arun Isaac
2018-12-16 15:09 ` Ludovic Courtès
2018-12-16 18:28   ` bug#33738: " Arun Isaac

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).