1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-14 19:10:49 +02:00

gnu: go-github-com-google-go-cmp-cmp: Enable all tests.

* gnu/packages/golang.scm (go-github-com-google-go-cmp-cmp) [arguments]:
<#:phases>: Adjust custom 'check phase to run all available tests inside
each submodule and respect "tests?' parameter.

Change-Id: I85eacbb4c3221d34a2e7cf6a9f6cfde363ded71c
This commit is contained in:
Sharlatan Hellseher 2024-07-19 22:18:22 +01:00
parent 770a668505
commit bdff9d2642
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -5950,11 +5950,17 @@ filters for Go.")
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'check (replace 'check
(lambda* (#:key inputs #:allow-other-keys #:rest args) (lambda* (#:key tests? import-path inputs #:allow-other-keys)
(unless (when tests?
;; The tests fail when run with gccgo. ;; The tests fail when run with gccgo.
(false-if-exception (search-input-file inputs "/bin/gccgo")) (let ((gccgo? (false-if-exception
(apply (assoc-ref %standard-phases 'check) args))))))) (search-input-file inputs "/bin/gccgo"))))
(if gccgo?
(format #t "skipping tests with gccgo compiler~%")
;; XXX: Workaround for go-build-system's lack of Go
;; modules support.
(with-directory-excursion (string-append "src/" import-path)
(invoke "go" "test" "-v" "./..."))))))))))
(synopsis "Determine equality of values in Go") (synopsis "Determine equality of values in Go")
(home-page "https://github.com/google/go-cmp") (home-page "https://github.com/google/go-cmp")
(description (description