[bug#77131,15/51] gnu: emacs-persp-mode: Fix tests.

Message ID 20250320100907.20485-15-ngraves@ngraves.fr
State New
Headers
Series [bug#77131,01/51] gnu: Add (gnu packages emacs-build) module. |

Commit Message

Nicolas Graves March 20, 2025, 10:08 a.m. UTC
  * gnu/packages/emacs-xyz.scm (emacs-persp-mode)[arguments]: Add
{test-command} and phase 'tests-add-lexical-bindings.
[native-inputs]: Add emacs-buttercup.
---
 gnu/packages/emacs-xyz.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)
  

Patch

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 1ea5fe6aa1..93547a8d2a 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -13933,6 +13933,18 @@  (define-public emacs-persp-mode
         (base32
          "0y29vyvqdfxcpmzkyv2c6msbshx2f680izk2r0djrqj08ii8zmpr"))))
     (build-system emacs-build-system)
+    (arguments
+     (list #:test-command
+           #~(list "buttercup" "-L" "." "-L" "tests")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'check 'tests-add-lexical-bindings
+                 (lambda _
+                   (substitute* "tests/test-persp-mode.el"
+                     (("\\(require 'buttercup-init\\)" all)
+                      (string-append ";;; -*- lexical-binding: t; -*-\n"
+                                     all))))))))
+    (native-inputs (list emacs-buttercup))
     (home-page "https://github.com/Bad-ptr/persp-mode.el")
     (synopsis "Switch between named \"perspectives\" shared among frames")
     (description