summaryrefslogtreecommitdiff
path: root/gnu/packages/golang-check.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/golang-check.scm')
-rw-r--r--gnu/packages/golang-check.scm146
1 files changed, 117 insertions, 29 deletions
diff --git a/gnu/packages/golang-check.scm b/gnu/packages/golang-check.scm
index dd0b71ff13..0822338943 100644
--- a/gnu/packages/golang-check.scm
+++ b/gnu/packages/golang-check.scm
@@ -62,10 +62,36 @@
;;; Libraries:
;;;
+(define-public go-atomicgo-dev-assert
+ (package
+ (name "go-atomicgo-dev-assert")
+ (version "0.0.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/atomicgo/assert")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1ra5bx3w6vynwbxgsz5knibk2xwmfi6654fsi29zsmk77f39g8vv"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "atomicgo.dev/assert"))
+ (home-page "https://atomicgo.dev/assert")
+ (synopsis "Go package with tons of assertions")
+ (description
+ "Package assert provides obj set of assertion functions. Every assertion
+function returns obj boolean. This package does not integrate into the
+testing package automatically and requires to check the returning boolean
+value and call @code{t.Fatal()} if the assertion fails.")
+ (license license:expat)))
+
(define-public go-github-com-alecthomas-assert-v2
(package
(name "go-github-com-alecthomas-assert-v2")
- (version "2.5.0")
+ (version "2.10.0")
(source
(origin
(method git-fetch)
@@ -74,11 +100,11 @@
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1ai26ncfcwzg47rqaigs5v1fzfz6i8p11ki75ni5429xkjs77riz"))))
+ (base32 "05jak1v9s2wrwrn6ar0s4388f7qg15q0qfmhfcswgl88720196z3"))))
(build-system go-build-system)
(arguments
- (list #:go go-1.18
- #:import-path "github.com/alecthomas/assert/v2"))
+ (list
+ #:import-path "github.com/alecthomas/assert/v2"))
(propagated-inputs
(list go-github-com-alecthomas-repr
go-github-com-hexops-gotextdiff))
@@ -577,6 +603,50 @@ Many times certain facilities are not available, or tests must run
differently.")
(license license:expat)))
+(define-public go-github-com-marvinjwendt-testza
+ (package
+ (name "go-github-com-marvinjwendt-testza")
+ (version "0.5.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/MarvinJWendt/testza")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0mqvs9142wx3a352yj0zxcm8f3mclyqzzxjlpn1rsb3vrskgs8v9"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "github.com/MarvinJWendt/testza"
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; An error that should be nil is not nil. Error message: "creating
+ ;; snapshot failed: <...> permission denied
+ (add-before 'check 'writable-test-file
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/"
+ import-path
+ "/testdata/snapshots")
+ (for-each make-file-writable
+ (list "TestSnapshotCreate_file_content.testza"
+ "TestSnapshotCreate_file_content_string.testza"))))))))
+ (propagated-inputs
+ (list go-atomicgo-dev-assert
+ go-github-com-sergi-go-diff
+ go-github-com-davecgh-go-spew
+ go-github-com-klauspost-cpuid-v2
+ go-github-com-pterm-pterm))
+ (home-page "https://github.com/MarvinJWendt/testza")
+ (synopsis "Full-featured test framework for Golang")
+ (description
+ "Package testza is a full-featured testing framework for Go. It
+integrates with the default test runner, so you can use it with the standard
+@code{go test} tool. Testza contains easy to use methods, like assertions,
+output capturing, mocking, and much more.")
+ (license license:expat)))
+
(define-public go-github-com-onsi-ginkgo
(package
(name "go-github-com-onsi-ginkgo")
@@ -624,7 +694,6 @@ Gomega matcher library.")
(base32 "1w5dldjjcz2kpyxml4zd9yah7galfpmhcpc2l4zc5pr3skpwpibv"))))
(arguments
(list
- #:go go-1.20
#:import-path "github.com/onsi/ginkgo/v2"))
(propagated-inputs
(list go-github-com-go-logr-logr
@@ -654,7 +723,6 @@ Gomega matcher library.")
;; Unless we disable the tests, we have a circular dependency on
;; ginkgo/v2.
#:tests? #f
- #:go go-1.21
#:import-path "github.com/onsi/gomega"))
(propagated-inputs
(list go-github-com-golang-protobuf
@@ -670,6 +738,30 @@ Gomega matcher library.")
framework.")
(license license:expat)))
+(define-public go-github-com-otiai10-mint
+ (package
+ (name "go-github-com-otiai10-mint")
+ (version "1.6.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/otiai10/mint")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0g5zhz4znp68427p2a1yvrxbq90y7caagdd7zsb4iygnhdszfm7w"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "github.com/otiai10/mint"))
+ (home-page "https://github.com/otiai10/mint")
+ (synopsis "Minimal assertion for Golang testing framework")
+ (description
+ "Mint (@code{mint.Mint}) is wrapper for @code{*testing.T} blending
+testing type to omit repeated @code{t}.")
+ (license license:expat)))
+
(define-public go-github-com-pkg-profile
(package
(name "go-github-com-pkg-profile")
@@ -1132,7 +1224,6 @@ custom assertions to be used alongside native Go testing.")
(build-system go-build-system)
(arguments
(list
- #:go go-1.21
#:import-path "github.com/warpfork/go-testmark"))
(home-page "https://github.com/warpfork/go-testmark")
(synopsis "Parser for @code{testmark} format")
@@ -1161,7 +1252,6 @@ testmark} format, which itself is a subset of Markdown format.")
(build-system go-build-system)
(arguments
(list
- #:go go-1.21
#:import-path "github.com/warpfork/go-wish"))
(home-page "https://github.com/warpfork/go-wish")
(synopsis "Test assertions for Golang")
@@ -1217,7 +1307,6 @@ the end of a test.")
;; XXX: The project contains subdirectory which complicate it's testing
;; and it does not produce any binary.
#:tests? #f
- #:go go-1.20
#:import-path "go.uber.org/mock"
#:phases
#~(modify-phases %standard-phases
@@ -1234,7 +1323,7 @@ built-in @code{testing} package, but can be used in other contexts too.")
(define-public go-honnef-co-go-tools
(package
(name "go-honnef-co-go-tools")
- (version "0.4.6")
+ (version "0.4.7")
(source
(origin
(method git-fetch)
@@ -1244,17 +1333,23 @@ built-in @code{testing} package, but can be used in other contexts too.")
(file-name (git-file-name name version))
(sha256
(base32
- "0qikkhanmc0vrpgvs0c44y853n88m8qqsk08zry6mvm8f41pgjhi"))))
+ "1n58skq2a0vhsgdfdkyqi00d3vv13kiw9b4mxx6xfyb6ysrdy7d1"))))
(build-system go-build-system)
(arguments
- `(#:import-path "honnef.co/go/tools"
- #:tests? #f
- ;; Source-only package
- #:phases (modify-phases %standard-phases
- (delete 'build))))
+ (list
+ #:import-path "honnef.co/go/tools"
+ #: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" "./..."))))))))
(propagated-inputs
(list go-github-com-burntsushi-toml
- go-golang-org-x-exp
+ go-golang-org-x-exp-typeparams
go-golang-org-x-mod
go-golang-org-x-tools))
(home-page "https://staticcheck.dev/")
@@ -1313,7 +1408,6 @@ thoroughly
(name "ginkgo")
(arguments
(list
- #:go go-1.20
#:import-path "github.com/onsi/ginkgo/ginkgo"
#:unpack-path "github.com/onsi/ginkgo"
#:install-source? #f))
@@ -1327,8 +1421,7 @@ tool."))))
(inherit go-honnef-co-go-tools)
(name "go-keyify")
(arguments
- `(#:go ,go-1.20
- #:import-path "honnef.co/go/tools/cmd/keyify"
+ `(#:import-path "honnef.co/go/tools/cmd/keyify"
#:unpack-path "honnef.co/go/tools"
#:install-source? #f))
(synopsis "Transform an unkeyed struct literal into a keyed one in Go")
@@ -1342,7 +1435,6 @@ tool."))))
(arguments
(list
#:install-source? #f
- #:go go-1.19
#:import-path "github.com/google/pprof"))
(description
(string-append (package-description go-github-com-google-pprof)
@@ -1354,8 +1446,7 @@ tool."))))
(inherit go-honnef-co-go-tools)
(name "go-staticcheck")
(arguments
- `(#:go ,go-1.20
- #:import-path "honnef.co/go/tools/cmd/staticcheck"
+ `(#:import-path "honnef.co/go/tools/cmd/staticcheck"
#:unpack-path "honnef.co/go/tools"
#:install-source? #f))
(synopsis "Staticcheck advanced Go linter")
@@ -1369,8 +1460,7 @@ simplifications, and enforces style rules.")))
(inherit go-honnef-co-go-tools)
(name "go-structlayout")
(arguments
- `(#:go ,go-1.20
- #:import-path "honnef.co/go/tools/cmd/structlayout"
+ `(#:import-path "honnef.co/go/tools/cmd/structlayout"
#:unpack-path "honnef.co/go/tools"
#:install-source? #f))
(synopsis "Display the layout (field sizes and padding) of structs in Go")
@@ -1384,8 +1474,7 @@ flag.")))
(inherit go-honnef-co-go-tools)
(name "go-structlayout-optimize")
(arguments
- `(#:go ,go-1.20
- #:import-path "honnef.co/go/tools/cmd/structlayout-optimize"
+ `(#:import-path "honnef.co/go/tools/cmd/structlayout-optimize"
#:unpack-path "honnef.co/go/tools"
#:install-source? #f))
(synopsis "Reorder struct fields to minimize the amount of padding in Go")
@@ -1398,8 +1487,7 @@ into @code{go-structlayout-pretty}.")))
(inherit go-honnef-co-go-tools)
(name "go-structlayout-pretty")
(arguments
- `(#:go ,go-1.20
- #:import-path "honnef.co/go/tools/cmd/structlayout-pretty"
+ `(#:import-path "honnef.co/go/tools/cmd/structlayout-pretty"
#:unpack-path "honnef.co/go/tools"
#:install-source? #f))
(synopsis "Format the output of go-structlayout with ASCII art in Go")