unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brett Gilio <brettg@posteo.net>
To: 38463@debbugs.gnu.org
Subject: [bug#38463] [PATCH 1/2] gnu: emacs-telega: Use test suites.
Date: Mon, 02 Dec 2019 15:34:48 -0600	[thread overview]
Message-ID: <87mucah0nb.fsf@posteo.net> (raw)
In-Reply-To: <87r21mh0pt.fsf@posteo.net>

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


-- 
Brett M. Gilio
https://git.sr.ht/~brettgilio/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH 1/2] gnu: emacs-telega: Use test suites. --]
[-- Type: text/x-patch, Size: 3759 bytes --]

From 03a2617b29c92dc83828495305d73ec4074a5102 Mon Sep 17 00:00:00 2001
From: Brett Gilio <brettg@posteo.net>
Date: Mon, 2 Dec 2019 15:26:27 -0600
Subject: [PATCH 1/2] gnu: emacs-telega: Use test suites.

* gnu/packages/emacs-xyz.scm (emacs-telega)[arguments]: Adds support for
  running the ert and server test suites.
---
 gnu/packages/emacs-xyz.scm | 39 +++++++++++++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 8efa4a17c8..ad78209ebb 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -19974,7 +19974,7 @@ fish-completion.  It can be used in both Eshell and M-x shell.")
          (file-name (git-file-name name version))))
       (build-system gnu-build-system)
       (arguments
-       `(#:tests? #f
+       `(#:test-target "test"
          #:modules ((guix build gnu-build-system)
                     ((guix build emacs-build-system) #:prefix emacs:)
                     (guix build utils)
@@ -19984,17 +19984,45 @@ fish-completion.  It can be used in both Eshell and M-x shell.")
                              (guix build emacs-utils))
          #:phases
          (modify-phases %standard-phases
-           (add-after 'unpack 'unpack-patch
+           (add-after 'unpack 'prefix-patch
              (lambda _
                (substitute* "server/Makefile"
                  (("CC=cc")
                   "CC=gcc")
                  (("INSTALL_PREFIX=\\$\\(HOME\\)/.telega")
                   (string-append "INSTALL_PREFIX=" (assoc-ref %outputs "out")
-                                 "/bin")))
+                                 "/bin"))
+                 ;; Manually invoke `run_tests.py` after install phase.
+                 (("python3 run_tests.py")
+                  ""))
+               #t))
+           ;; The telega test suite checks for a version of Emacs
+           ;; compiled with imagemagick and svg support. Since we
+           ;; are using `emacs-minimal`, this step will fail.
+           ;; Grok the failing test, and remove problematic assertions.
+           (add-after 'unpack 'ert-suite-patch
+             (lambda _
+               (substitute* "telega-core.el"
+                 (("\\(image-type-available-p 'imagemagick\\) nil")
+                  "t")
+                 (("\\(image-type-available-p 'svg\\) nil")
+                  "t"))
+               #t))
+           ;; The server test suite has a hardcoded path.
+           ;; Reset this behavior to use the proper path.
+           (add-after 'unpack 'server-suite-patch
+             (lambda _
+               (substitute* "server/run_tests.py"
+                 (("~/.telega/telega-server")
+                  (string-append (assoc-ref %outputs "out")
+                                 "/bin/telega-server")))
+               #t))
+           (add-after 'install 'run-server-suite
+             (lambda _
+               (invoke "python3" "server/run_tests.py")
                #t))
            (delete 'configure)
-
+           
            ;; Build emacs-side using `emacs-build-system'
            (add-after 'compress-documentation 'emacs-add-source-to-load-path
              (assoc-ref emacs:%standard-phases 'add-source-to-load-path))
@@ -20008,7 +20036,8 @@ fish-completion.  It can be used in both Eshell and M-x shell.")
        `(("emacs-visual-fill-column" ,emacs-visual-fill-column)))
       (native-inputs
        `(("tdlib" ,tdlib)
-         ("emacs" ,emacs-minimal)))
+         ("emacs" ,emacs-minimal)
+         ("python" ,python)))
       (synopsis "GNU Emacs client for the Telegram messenger")
       (description
        "Telega is full-featured, unofficial client for the Telegram messaging
-- 
2.24.0


  reply	other threads:[~2019-12-02 21:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 21:33 [bug#38463] [PATCH] Telega test suite and change in revision Brett Gilio
2019-12-02 21:34 ` Brett Gilio [this message]
2019-12-02 21:35 ` [bug#38463] [PATCH 2/2] gnu: emacs-telega: Update to 0.4.4-2 Brett Gilio
2019-12-05  0:36 ` [bug#38463] [PATCH] Telega test suite and change in revision Brett Gilio
2019-12-05 13:50 ` [bug#38463] [PATCH 3/3] gnu: emacs-telega: Properly install alists Brett Gilio
2019-12-05 17:31 ` Leo Prikler
2019-12-05 18:00   ` Brett Gilio
2019-12-05 18:18     ` Leo Prikler
2019-12-05 18:46       ` Brett Gilio
2019-12-05 22:55         ` Leo Prikler
2019-12-05 20:01 ` [bug#38463] [PATCH 3/3] gnu: emacs-telega: Install telega-data to site-lisp Brett Gilio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mucah0nb.fsf@posteo.net \
    --to=brettg@posteo.net \
    --cc=38463@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).