Subject: [bug#76686] [PATCH emacs-team] gnu: emacs-plantuml-mode: Fix tests.

From: Cayetano Santos <[email-masked]>
Date: Tue, 22 Apr 2025 12:31:40 +0200

* gnu/packages/emacs-xyz.scm (emacs-plantuml-mode): Fix tests.

Change-Id: I17fe62eddcb683a81ad19dc7fa4ea5dced7c5cbd
---
 gnu/packages/emacs-xyz.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index ad9add40f5..6d19b53fe9 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -40856,8 +40856,22 @@ (define-public emacs-plantuml-mode
        (sha256
         (base32 "0yp41d2dmf3sx7qnl5x0zdjcr9y71b2wwc9m0q31v22xqn938ipc"))))
     (arguments
-     '(#:phases
+     '(#:test-command '("make" "unit")
+       #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'fix-tests
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((plantuml (assoc-ref inputs "plantuml"))
+                    (jar (string-append plantuml "/share/java/plantuml.jar")))
+               (emacs-substitute-variables "test/test-helper.el"
+                 ("plantuml-test-jar-path" jar))
+               (substitute* "test/plantuml-mode-test.el"
+                 (("\\~\\/plantuml\\.jar") jar)))
+             ;; Do not use cask to run tests.
+             (substitute* "Makefile"
+               (("\\$\\{CASK\\} exec ") ""))
+             ;; returns PLANTUML Preview failed: exited abnormally with code 1
+             (delete-file "test/plantuml-preview-test.el")))
          (add-after 'unpack 'use-local-plantuml
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((plantuml (assoc-ref inputs "plantuml"))
@@ -40882,6 +40896,7 @@ (define-public emacs-plantuml-mode
      (list plantuml))
     (propagated-inputs
      (list emacs-dash))
+    (native-inputs (list emacs-ert-runner icedtea))
     (build-system emacs-build-system)
     (home-page "https://github.com/skuro/plantuml-mode")
     (synopsis "Major mode for editing PlantUML sources")

base-commit: 5e1ae1d2041255cb0da37071482f2af86ed84ba3
-- 
2.49.0