summary refs log tree commit diff
path: root/gnu/packages/glib.scm
diff options
context:
space:
mode:
author宋文武 <iyzsong@gmail.com>2016-04-03 09:43:51 +0800
committerLudovic Courtès <ludo@gnu.org>2016-04-16 11:44:24 +0200
commit7c951767c09c7f97c0777d8a15d3de6559a2b4da (patch)
tree7bb735f814945331ac12301efa6d993192007ab1 /gnu/packages/glib.scm
parent7dd99e5573581d391e2318a4b1a314e593ee0541 (diff)
downloadguix-7c951767c09c7f97c0777d8a15d3de6559a2b4da.tar.gz
gnu: glib: Disable tests in build phases instead of patches.
* gnu/packages/glib.scm (glib)[sources]: Remove glib-tests-desktop.patch,
glib-tests-prlimit.patch and glib-tests-gapplicatiotn.patch.
[arguments]: Add 'disable-falling-tests' phase.
* gnu/packages/patches/glib-tests-timer.patch: Adjust accordingly.
* gnu/packages/patches/glib-tests-desktop.patch,
  gnu/packages/patches/glib-tests-gapplication.patch,
  gnu/packages/patches/glib-tests-prlimit.patch: Remove files.
* gnu-system.am (dist_patch_DATA): Remove them.
Diffstat (limited to 'gnu/packages/glib.scm')
-rw-r--r--gnu/packages/glib.scm75
1 files changed, 61 insertions, 14 deletions
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 13f3f3a8a2..25b6a81d70 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -138,10 +138,7 @@ shared NFS home directories.")
             (sha256
              (base32
               "1yzxr1ip3l0m9ydk5nq32piq70c9f17p5f0jyvlsghzbaawh67ss"))
-            (patches (search-patches "glib-tests-desktop.patch"
-                                     "glib-tests-prlimit.patch"
-                                     "glib-tests-timer.patch"
-                                     "glib-tests-gapplication.patch"))))
+            (patches (search-patches "glib-tests-timer.patch"))))
    (build-system gnu-build-system)
    (outputs '("out"           ; everything
               "bin"           ; glib-mkenums, gtester, etc.; depends on Python
@@ -176,16 +173,66 @@ shared NFS home directories.")
                            "glib/tests/utils.c"
                            "tests/spawn-test.c")
               (("/bin/sh")
-               (string-append (assoc-ref inputs "bash") "/bin/sh")))
-
-            ;; Disable a test that requires /etc/machine-id.
-            (substitute* "gio/tests/gdbus-peer.c"
-              (("g_test_add_func.*/gdbus/codegen-peer-to-peer.*") ""))
-            ;; Disable a test that requires dbus.
-            (substitute* "gio/tests/gdbus-serialization.c"
-              (("g_test_add_func \
-\\(\"/gdbus/message-serialize/double-array\", test_double_array\\);" all)
-               (string-append "/* " all " */"))))))
+               (string-append (assoc-ref inputs "bash") "/bin/sh")))))
+        (add-before 'check 'disable-failing-tests
+          (lambda _
+            (let ((disable
+                   (lambda (test-file test-paths)
+                     (define pattern+procs
+                       (map (lambda (test-path)
+                              (cons
+                               ;; XXX: only works for single line statements.
+                               (format #f "g_test_add_func.*\"~a\".*" test-path)
+                               (const "")))
+                            test-paths))
+                     (substitute test-file pattern+procs)))
+                  (failing-tests
+                   '(("glib/tests/thread.c"
+                      (;; prlimit(2) returns ENOSYS on Linux 2.6.32-5-xen-amd64
+                       ;; as found on hydra.gnu.org, and strace(1) doesn't
+                       ;; recognize it.
+                       "/thread/thread4"))
+
+                     ("glib/tests/timer.c"
+                      (;; fails if compiler optimizations are enabled, which they
+                       ;; are by default.
+                       "/timer/stop"))
+
+                     ("gio/tests/gapplication.c"
+                      (;; XXX: proven to be unreliable.  See:
+                       ;;  <https://bugs.debian.org/756273>
+                       ;;  <http://bugs.gnu.org/18445>
+                       "/gapplication/quit"))
+
+                     ("gio/tests/contenttype.c"
+                      (;; XXX: requires shared-mime-info.
+                       "/contenttype/guess"
+                       "/contenttype/subtype"
+                       "/contenttype/list"
+                       "/contenttype/icon"
+                       "/contenttype/symbolic-icon"
+                       "/contenttype/tree"))
+
+                     ("gio/tests/appinfo.c"
+                      (;; XXX: requires update-desktop-database.
+                       "/appinfo/associations"))
+
+                     ("gio/tests/desktop-app-info.c"
+                      (;; XXX: requires update-desktop-database.
+                       "/desktop-app-info/delete"
+                       "/desktop-app-info/default"
+                       "/desktop-app-info/fallback"
+                       "/desktop-app-info/lastused"
+                       "/desktop-app-info/search"))
+
+                     ("gio/tests/gdbus-peer.c"
+                      (;; Requires /etc/machine-id.
+                       "/gdbus/codegen-peer-to-peer"))
+
+                     ("gio/tests/gdbus-unix-addresses.c"
+                      (;; Requires /etc/machine-id.
+                       "/gdbus/x11-autolaunch")))))
+              (and-map (lambda (x) (apply disable x)) failing-tests)))))
 
       ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
       #:configure-flags (list (string-append "--with-html-dir="