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.
This commit is contained in:
Maxim Cournoyer 2022-05-27 11:48:14 -04:00
parent 34c8558af2
commit d11d27e2e4
No known key found for this signature in database
GPG key ID: 1260E46482E63562
3 changed files with 42 additions and 2 deletions

View file

@ -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 \

View file

@ -3843,7 +3843,8 @@ (define-public guile-ac-d-bus
(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 @@ (define (guile-sls->sls file)
(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")

View file

@ -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))