guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

23/76: gnu: go-golang-org-x-text: Enable tests.


From: guix-commits
Subject: 23/76: gnu: go-golang-org-x-text: Enable tests.
Date: Mon, 15 Jul 2024 07:19:44 -0400 (EDT)

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

commit e0ca0978c8ffdb9e8954a82d7a18945bd359e823
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Fri Jul 12 15:03:34 2024 +0100

    gnu: go-golang-org-x-text: Enable tests.
    
    * gnu/packages/golang-build.scm (go-golang-org-x-text): Enable tests.
    [source]: Adjust FILE-NAME.
    [arguments]: <#:phases>: Use custom 'check phase.
    [description]: Place on a new line.
    
    Change-Id: I1f72a418d60c92c3663bcc6603e705f8a715370a
---
 gnu/packages/golang-build.scm | 41 ++++++++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm
index a0f7008bd0..487dc00ccb 100644
--- a/gnu/packages/golang-build.scm
+++ b/gnu/packages/golang-build.scm
@@ -491,21 +491,44 @@ terminals, as commonly found on Unix systems.")
        (uri (git-reference
              (url "https://go.googlesource.com/text";)
              (commit (string-append "v" version))))
-       (file-name (string-append "go.googlesource.com-text-"
-                                 version "-checkout"))
+       (file-name (git-file-name name version))
        (sha256
         (base32 "0pmn0i1xbpwvzl4cdgmjqcsk9vckhqrq6699fnr9mkglh4xj3p7a"))))
     (build-system go-build-system)
     (arguments
-     `(#:import-path "golang.org/x/text"
-       ;; Source-only package
-       #:tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'build))))
+     (list
+      #:import-path "golang.org/x/text"
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; XXX: Workaround for go-build-system's lack of Go modules
+          ;; support.
+          (delete 'build)
+          (replace 'check
+            (lambda* (#:key tests? import-path #:allow-other-keys)
+              (when tests?
+                (with-directory-excursion (string-append "src/" import-path)
+                  (invoke "go" "test" "-v"
+                          "./cases/..."
+                          ;; cmd - cycle with go-golang-org-x-tools
+                          "./collate/..."
+                          "./currency/..."
+                          "./date/..."
+                          "./encoding/..."
+                          "./feature/..."
+                          "./internal/..."
+                          "./language/..."
+                          ;; message - cycle with go-golang-org-x-tools
+                          "./number/..."
+                          "./runes/..."
+                          "./search/..."
+                          "./secure/..."
+                          "./transform/..."
+                          "./unicode/..."
+                          "./width/..."))))))))
     (home-page "https://go.googlesource.com/text";)
     (synopsis "Supplemental Go text processing libraries")
-    (description "This package provides supplemental Go libraries for text
+    (description
+     "This package provides supplemental Go libraries for text
 processing.")
     (license license:bsd-3)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]