guix-commits
[Top][All Lists]
Advanced

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

82/97: gnu: Add go-github-com-golang-mock.


From: guix-commits
Subject: 82/97: gnu: Add go-github-com-golang-mock.
Date: Sun, 15 Sep 2024 16:28:49 -0400 (EDT)

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

commit 0de0444d8b71730d51b0011010c48d1d250d1e2a
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Sun Sep 15 13:10:39 2024 +0100

    gnu: Add go-github-com-golang-mock.
    
    * gnu/packages/golang-check.scm (go-github-com-golang-mock): New variable.
    
    Change-Id: I9ae851e7eb1e4950594387604a41af330b8b4127
---
 gnu/packages/golang-check.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/golang-check.scm b/gnu/packages/golang-check.scm
index 914b5ea59b..11a8e365f9 100644
--- a/gnu/packages/golang-check.scm
+++ b/gnu/packages/golang-check.scm
@@ -360,6 +360,46 @@ reflect.DeepEqual but returns a list of differences.  This 
is helpful
 when comparing complex types like structures and maps.")
     (license license:expat)))
 
+(define-public go-github-com-golang-mock
+  (package
+    (name "go-github-com-golang-mock")
+    (version "1.6.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/golang/mock";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1hara8j0x431njjhqxfrg1png7xa1gbrpwza6ya4mwlx76hppap4"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/golang/mock"
+      #: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"
+                          ;; Network access required
+                          "-skip" "TestFileParser|TestImportsOfFile"
+                          "./..."))))))))
+    (propagated-inputs
+     (list go-golang-org-x-tools go-golang-org-x-mod))
+    (home-page "https://github.com/golang/mock";)
+    (synopsis "Mocking framework for Golang")
+    (description
+     "gomock is a mocking framework for the @url{http://golang.org/,Go
+programming language}.  It integrates well with Go's built-in @code{testing}
+package, but can be used in other contexts too.")
+    (license license:asl2.0)))
+
 (define-public go-github-com-golangplus-testing
   (package
     (name "go-github-com-golangplus-testing")



reply via email to

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