From d11d27e2e4a0e6d132127f5130533b0ce9d04481 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 27 May 2022 11:48:14 -0400 Subject: [PATCH] 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. --- gnu/local.mk | 1 + gnu/packages/guile-xyz.scm | 15 ++++++++-- .../patches/guile-ac-d-bus-fix-tests.patch | 28 +++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/guile-ac-d-bus-fix-tests.patch 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 @@ (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") 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))