sharlatan pushed a commit to branch go-team
in repository guix.

commit bdff9d26423a62f246882a46c5440c144c54910c
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Fri Jul 19 22:18:22 2024 +0100

    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
---
 gnu/packages/golang.scm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a5d199df2c..6bc9b3a6d5 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -5950,11 +5950,17 @@ filters for Go.")
       #:phases
       #~(modify-phases %standard-phases
           (replace 'check
-            (lambda* (#:key inputs #:allow-other-keys #:rest args)
-              (unless
-                  ;; The tests fail when run with gccgo.
-                  (false-if-exception (search-input-file inputs "/bin/gccgo"))
-                (apply (assoc-ref %standard-phases 'check) args)))))))
+            (lambda* (#:key tests? import-path inputs #:allow-other-keys)
+              (when tests?
+                ;; The tests fail when run with gccgo.
+                (let ((gccgo? (false-if-exception
+                               (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")
     (home-page "https://github.com/google/go-cmp";)
     (description

Reply via email to