Subject: [bug#50084] [PATCH v2] gnu: waypipe: Enable tests.

From: Robby Zambito <[email-masked]>
Date: Wed, 18 Aug 2021 16:27:11 -0400

* gnu/packages/xdisorg.scm (waypipe): Don't skip tests. Add dependencies
  required to run the tests.
---
This is my first contribution to guix, I was not aware of how to do what
was needed to properly pass the tests for this package. After consulting
#guix on IRC, I have believe I have made the necessary changes.

 gnu/packages/xdisorg.scm | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index d79f580b47..ba520d35ae 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -881,13 +881,24 @@ include cursor in the resulting image.")
        (sha256
         (base32 "1qa47ljfvb1vv3h647xwn1j5j8gfmcmdfaz4j8ygnkvj36y87vnz"))))
     (build-system meson-build-system)
-    ;; One test fails where the program does not exit cleanly given a bad
-    ;; setup. Not ideal but probably safe to ignore. Check that no other tests
-    ;; fail before bumping the version. If all tests pass, remove this.
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (delete 'check))))
+         (add-after 'unpack 'fix-sleep-path
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (coreutils (assoc-ref inputs "coreutils")))
+               (substitute* "./test/startup_failure.py"
+                 (("sleep")
+                  (string-append coreutils "/bin/sleep")))
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("scdoc" ,scdoc)))
+    (inputs
+     ;; For tests
+     `(("python" ,python)
+       ("coreutils" ,coreutils)))
     (home-page "https://gitlab.freedesktop.org/mstoeckl/waypipe")
     (synopsis "Proxy for Wayland protocol applications")
     (description "Waypipe is a proxy for Wayland clients, with the aim of
-- 
2.32.0