guix-patches
[Top][All Lists]
Advanced

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

[bug#47770] [PATCH core-updates 4/4] gnu: ibus: Enable tests.


From: Raghav Gururajan
Subject: [bug#47770] [PATCH core-updates 4/4] gnu: ibus: Enable tests.
Date: Wed, 14 Apr 2021 07:53:49 -0400

* gnu/packages/ibus.scm (ibus)[arguments](tests): Remove argument.
(parallel-tests): New argument.
[patches](disable-failing-tests): New phase.
(pre-check): New phase.
[native-inputs]: Add xorg-server-for-tests.
---
 gnu/packages/ibus.scm | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 3f151d9cd7..7e7d6c64d1 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -76,7 +76,7 @@
     (build-system glib-or-gtk-build-system)
     (outputs '("out" "doc"))
     (arguments
-     `(#:tests? #f  ; tests fail because there's no connection to dbus
+     `(#:parallel-tests? #f
        #:parallel-build? #f ; race condition discovered with emoji support
        #:configure-flags (list "--enable-python-library"
                                "--enable-gtk-doc"
@@ -95,6 +95,14 @@
                                "--enable-wayland")
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'disable-failing-tests
+           (lambda _
+             ;; These tests require /etc/machine-id.
+             (with-directory-excursion "src/tests"
+               (substitute* '("ibus-share.c" "ibus-compose.c"
+                              "ibus-keypress.c")
+                 (("[ \t]*return g_test_run \\(\\);") "")))
+             #t))
          (add-after 'unpack 'patch-docbook-xml
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "docs/reference/ibus"
@@ -102,7 +110,7 @@
                  (("http://www.oasis-open.org/docbook/xml/4.1.2/";)
                   (string-append (assoc-ref inputs "docbook-xml")
                                  "/xml/dtd/docbook/"))))
-              #t))
+             #t))
          (add-after 'unpack 'patch-python-target-directories
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((root (string-append (assoc-ref outputs "out")
@@ -139,6 +147,20 @@
                (("\"(setxkbmap|xmodmap)\"" _ prog)
                 (string-append "\"" (assoc-ref inputs prog) "/bin/" prog 
"\"")))
              #t))
+         (add-before 'check 'pre-check
+           (lambda _
+             ;; Tests write to $HOME.
+             (setenv "HOME" (getcwd))
+             ;; Tests look for $XDG_RUNTIME_DIR.
+             (setenv "XDG_RUNTIME_DIR" (getcwd))
+             ;; For missing '/etc/machine-id'.
+             (setenv "DBUS_FATAL_WARNINGS" "0")
+             ;; Tests require a running X server.
+             (system "Xvfb :1 +extension GLX &")
+             (setenv "DISPLAY" ":1")
+             ;; Tests require running iBus daemon.
+             (system "./bus/ibus-daemon --daemonize")
+             #t))
          (add-after 'install 'move-doc
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -186,12 +208,14 @@
        ("gettext" ,gettext-minimal)
        ("gnome-common" ,gnome-common)
        ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler
+       ("gtk+:bin" ,gtk+ "bin")
        ("gtk-doc" ,gtk-doc)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
        ("python-wrapper" ,python-wrapper)
        ("vala" ,vala)
-       ("which" ,which)))
+       ("which" ,which)
+       ("xorg-server" ,xorg-server-for-tests)))
     (native-search-paths
      (list (search-path-specification
             (variable "IBUS_COMPONENT_PATH")
-- 
2.31.1






reply via email to

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