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

From: Nicolas Graves <[email-masked]>
Date: Thu, 20 Mar 2025 11:08:23 +0100

* 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(+)

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
-- 
2.48.1