guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: gnu: weechat: Run tests.


From: Tobias Geerinckx-Rice
Subject: 03/03: gnu: weechat: Run tests.
Date: Thu, 21 Dec 2017 12:40:20 -0500 (EST)

nckx pushed a commit to branch master
in repository guix.

commit 00840ee004151c15c2207ea18efa153d49449435
Author: Tobias Geerinckx-Rice <address@hidden>
Date:   Thu Dec 21 18:37:31 2017 +0100

    gnu: weechat: Run tests.
    
    * gnu/packages/irc.scm (weechat)[native-inputs]: Add cpputest.
    [arguments]: Add ‘-DENABLE_TESTS=ON’ to #:configure-flags.  Add
    ‘disable-failing-tests’ phase to do just that.  Run the others.
---
 gnu/packages/irc.scm | 40 +++++++++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/irc.scm b/gnu/packages/irc.scm
index 0e0813c..ec329ad 100644
--- a/gnu/packages/irc.scm
+++ b/gnu/packages/irc.scm
@@ -163,8 +163,11 @@ SILC and ICB protocols via plugins.")
                 "1l854dramvn9vfba7jpazkjwm4k4i5pshq58vjv6z2mxmcp5hhv9"))
               (patches (search-patches "weechat-python.patch"))))
     (build-system cmake-build-system)
-    (native-inputs `(("gettext" ,gettext-minimal)
-                     ("pkg-config" ,pkg-config)))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("pkg-config" ,pkg-config)
+       ;; For tests.
+       ("cpputest" ,cpputest)))
     (inputs `(("ncurses" ,ncurses)
               ("libgcrypt" ,libgcrypt "out")
               ("zlib" ,zlib)
@@ -177,15 +180,30 @@ SILC and ICB protocols via plugins.")
               ("perl" ,perl)
               ("tcl" ,tcl)))
     (arguments
-     `(#:tests? #f ; tests require cpputime
-       #:phases (modify-phases %standard-phases
-                  (add-after 'install 'wrap
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      (let ((out (assoc-ref outputs "out"))
-                            (py2 (assoc-ref inputs "python")))
-                        (wrap-program (string-append out "/bin/weechat")
-                          `("PATH" ":" prefix (,(string-append py2 "/bin"))))
-                        #t))))))
+     `(#:configure-flags
+       (list "-DENABLE_TESTS=ON")       ; ‘make test’ fails otherwise
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           ;; For reasons best left to the imagination, CppUTest cannot skip
+           ;; more than one single test...  Resort to manual patching instead.
+           ;; See <https://cpputest.github.io/manual.html#command_line>.
+           (λ _
+             ;; Don't test plugin support for languages we don't enable.
+             (substitute* "tests/unit/test-plugins.cpp"
+               ((".*\\$\\{plugin.name\\} == (javascript|php|ruby)" all)
+                (string-append "// SKIP" all)))
+             (substitute* "tests/scripts/test-scripts.cpp"
+               ((".*\\{ \"(jvascript|php|ruby)\", " all) ; sic
+                (string-append "// SKIP" all)))
+             #t))
+         (add-after 'install 'wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (py2 (assoc-ref inputs "python")))
+               (wrap-program (string-append out "/bin/weechat")
+                 `("PATH" ":" prefix (,(string-append py2 "/bin"))))
+               #t))))))
     (synopsis "Extensible chat client")
     (description "WeeChat (Wee Enhanced Environment for Chat) is an
 @dfn{Internet Relay Chat} (IRC) client, which is designed to be light and fast.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]