summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-05-27 11:48:14 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-05-31 11:20:28 -0400
commitd11d27e2e4a0e6d132127f5130533b0ce9d04481 (patch)
treef107bbd45293c7810fc1420bca6b66c416ef3e5d
parent34c8558af2d0a72a7f90dab9106addbf9b3e6c5f (diff)
downloadguix-patches-d11d27e2e4a0e6d132127f5130533b0ce9d04481.tar
guix-patches-d11d27e2e4a0e6d132127f5130533b0ce9d04481.tar.gz
gnu: guile-ac-d-bus: Run test suite.
* gnu/packages/patches/guile-ac-d-bus-fix-tests.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/guile-xyz.scm (guile-ac-d-bus) [source]: Apply patch. [phases]{check}: New phase. [native-inputs]: Add bash-minimal.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/guile-xyz.scm15
-rw-r--r--gnu/packages/patches/guile-ac-d-bus-fix-tests.patch28
3 files changed, 42 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index bb2913c3a2..93b4902151 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1236,6 +1236,7 @@ dist_patch_DATA = \
%D%/packages/patches/guile-3.0-relocatable.patch \
%D%/packages/patches/guile-linux-syscalls.patch \
%D%/packages/patches/guile-3.0-linux-syscalls.patch \
+ %D%/packages/patches/guile-ac-d-bus-fix-tests.patch \
%D%/packages/patches/guile-cross-compilation.patch \
%D%/packages/patches/guile-fibers-destroy-peer-schedulers.patch \
%D%/packages/patches/guile-fibers-wait-for-io-readiness.patch \
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 0b1537a963..3c02a85bc3 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -3843,7 +3843,8 @@ and space linear in the size of the input text.")
(file-name (git-file-name name version))
(sha256
(base32
- "0rl809qimhgz6b0rixakb42r2l4g53jr09a2g0s1hxgab0blz0kb"))))
+ "0rl809qimhgz6b0rixakb42r2l4g53jr09a2g0s1hxgab0blz0kb"))
+ (patches (search-patches "guile-ac-d-bus-fix-tests.patch"))))
(build-system guile-build-system)
(arguments
(list
@@ -3884,12 +3885,22 @@ and space linear in the size of the input text.")
(lambda _
(with-directory-excursion "docs"
(invoke "makeinfo" "ac-d-bus"))))
+ (add-after 'build-doc 'check
+ (lambda* (#:key (tests? #t) #:allow-other-keys)
+ (when tests?
+ ;; There is no locale for the รถ character, which crashes
+ ;; substitute*; reset the conversion strategy to workaround it.
+ (with-fluids ((%default-port-conversion-strategy 'substitute))
+ (substitute* (find-files "tests")
+ (("#!/usr/bin/env scheme-script")
+ (string-append "#!" (which "guile")))))
+ (invoke "./run-tests.sh"))))
(add-after 'install 'install-doc
(lambda _
(install-file "docs/ac-d-bus.info"
(string-append #$output "/share/info")))))))
(native-inputs
- (list guile-3.0 texinfo))
+ (list bash-minimal guile-3.0 texinfo))
(propagated-inputs
(list guile-packrat))
(synopsis "D-Bus protocol implementation in R6RS Scheme")
diff --git a/gnu/packages/patches/guile-ac-d-bus-fix-tests.patch b/gnu/packages/patches/guile-ac-d-bus-fix-tests.patch
new file mode 100644
index 0000000000..19fd475c39
--- /dev/null
+++ b/gnu/packages/patches/guile-ac-d-bus-fix-tests.patch
@@ -0,0 +1,28 @@
+Submitted upstream: https://gitlab.com/weinholt/ac-d-bus/-/merge_requests/3
+
+diff --git a/tests/test-signature.sps b/tests/test-signature.sps
+index 278401b..cc5574f 100755
+--- a/tests/test-signature.sps
++++ b/tests/test-signature.sps
+@@ -43,6 +43,7 @@
+ (format-type-signature '(message BYTE BYTE BYTE BYTE UINT32 UINT32
+ (ARRAY (STRUCT BYTE VARIANT)))))
+
++(define fail-count (test-runner-fail-count (test-runner-get)))
+ (test-end)
+
+-(exit (if (zero? (test-runner-fail-count (test-runner-get))) 0 1))
++(exit (if (zero? fail-count) 0 1))
+diff --git a/tests/test-wire.sps b/tests/test-wire.sps
+index c3354bf..06ae73b 100755
+--- a/tests/test-wire.sps
++++ b/tests/test-wire.sps
+@@ -147,6 +147,7 @@
+ #x08 #x01 #x67 #x00 #x00 #x00 #x00 #x00 #x05 #x01 #x75 #x00 #x04 #x00 #x00 #x00
+ #x07 #x01 #x73 #x00 #x06 #x00 #x00 #x00 #x3A #x31 #x2E #x32 #x39 #x38 #x00 #x00)))
+
++(define fail-count (test-runner-fail-count (test-runner-get)))
+ (test-end)
+
+-(exit (if (zero? (test-runner-fail-count (test-runner-get))) 0 1))
++(exit (if (zero? fail-count) 0 1))