Subject: [PATCH 09/28] gnu: emacs-noman: Fix tests.

From: Nicolas Graves <[email-masked]>
Date: Sun, 27 Apr 2025 16:52:43 +0200

* gnu/packages/emacs-xyz.scm (emacs-noman): Fix tests.
  [source]<snippet>: Remove unwanted files.
  [arguments]<test-command>: Set it.
  <phases>: Patch tests to find bash.
  [native-inputs]: Add bash, emacs-ert-runner, emacs-f, makem-minimal.
---
 gnu/packages/emacs-xyz.scm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 5f6de3fbb2..f735020afa 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -6485,8 +6485,24 @@ (define-public emacs-noman
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0rh1p9nlhkmhfqmp507rz8hwfgwrdvxx0zba41lxsd2admai90wv"))))
+        (base32 "0rh1p9nlhkmhfqmp507rz8hwfgwrdvxx0zba41lxsd2admai90wv"))
+       (snippet #~(begin
+                    (for-each delete-file
+                              '("makem.sh" "Makefile" "screencast.gif"))))))
     (build-system emacs-build-system)
+    (arguments
+     (list #:test-command
+           #~(list #$(file-append (this-package-native-input "makem")
+                                  "/bin/makem.sh") "test")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-test
+                 (lambda _
+                   (substitute* "tests/noman-tests.el"
+                     (("#!/bin/bash")
+                      (string-append "#!" (which "bash")))))))))
+    (native-inputs
+     (list bash emacs-ert-runner emacs-f makem-minimal))
     (synopsis "Emacs package for browsing CLI command docs without man pages")
     (description
      "Noman is an Emacs package that parses command line help from flags like
-- 
2.49.0