From 93c943cd62bac86fc2ecb27d9a327d64f6552a3f Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 15 Sep 2024 13:10:39 +0100 Subject: 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") -- cgit v1.2.3