aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah Morgensen <iskarian@mgsn.dev>2024-08-29 01:02:52 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-09-03 15:43:09 +0100
commitc293aa1d6f41dc3dbe904dccb44b6177eb1e16e1 (patch)
tree7d7c833d33396108a434f90380fe768f29e44f61
parentd4da8af4e4aaf165ed384ff71d23dcce56554cf0 (diff)
downloadguix-c293aa1d6f41dc3dbe904dccb44b6177eb1e16e1.tar.gz
guix-c293aa1d6f41dc3dbe904dccb44b6177eb1e16e1.zip
gnu: go-github-com-godbus-dbus: Enable tests.
* gnu/packages/golang.scm (go-github-com-godbus-dbus): Enable tests. [arguments] <#:phases>: Add 'disable-failing-tests phase. Override 'check phase to run tests within a dbus session. Change-Id: Ib27d33363d4d7071e91380588413ae035ae9609f Co-authored-by: Sharlatan Hellseher <sharlatanus@gmail.com> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
-rw-r--r--gnu/packages/golang.scm18
1 files changed, 16 insertions, 2 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 381acd0853..648f5c1733 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6666,8 +6666,22 @@ RFC-5802 and RFC-7677.")
"0h0cl1r136g0kxbw3i7ggb9mhavpi1yr7d7312iwhkxm93dxkphg"))))
(build-system go-build-system)
(arguments
- `(#:tests? #f ;no /var/run/dbus/system_bus_socket
- #:import-path "github.com/godbus/dbus"))
+ (list
+ #:import-path "github.com/godbus/dbus"
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'disable-failing-tests
+ (lambda* (#:key tests? unpack-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" unpack-path)
+ (substitute* (find-files "." "\\_test.go$")
+ ;; Disable tests which require a system D-Bus instance.
+ (("TestSystemBus") "OffTestSystemBus")
+ (("TestConnectSystemBus") "OffTestConnectSystemBus")))))
+ (replace 'check
+ (lambda* (#:key tests? import-path #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion (string-append "src/" import-path)
+ (invoke "dbus-run-session" "--" "go" "test" "./..."))))))))
(native-inputs
(list dbus)) ;dbus-launch
(home-page "https://github.com/godbus/dbus/")