From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:41073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibtLU-0003Gt-AL for guix-patches@gnu.org; Mon, 02 Dec 2019 16:35:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibtLS-0005nk-Ay for guix-patches@gnu.org; Mon, 02 Dec 2019 16:35:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ibtLR-0005n7-Qi for guix-patches@gnu.org; Mon, 02 Dec 2019 16:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ibtLR-00018Z-O7 for guix-patches@gnu.org; Mon, 02 Dec 2019 16:35:01 -0500 Subject: [bug#38463] [PATCH 1/2] gnu: emacs-telega: Use test suites. References: <87r21mh0pt.fsf@posteo.net> In-Reply-To: <87r21mh0pt.fsf@posteo.net> Resent-Message-ID: From: Brett Gilio Date: Mon, 02 Dec 2019 15:34:48 -0600 Message-ID: <87mucah0nb.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38463@debbugs.gnu.org --=-=-= Content-Type: text/plain -- Brett M. Gilio https://git.sr.ht/~brettgilio/ --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-emacs-telega-Use-test-suites.patch Content-Description: [PATCH 1/2] gnu: emacs-telega: Use test suites. >From 03a2617b29c92dc83828495305d73ec4074a5102 Mon Sep 17 00:00:00 2001 From: Brett Gilio 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 --=-=-=--