PkgGoDev Test workflow Go Report Codecov

About

List tests in the given Go packages.

Installation

$ go install github.com/crazy-max/gotestlist/cmd/[email protected]

Usage

$ gotestlist .
gotestlist     TestTests     /home/crazy/src/github.com/crazy-max/gotestlist/gotestlist_test.go

$ gotestlist ./...
gotestlist     TestTests     /home/crazy/src/github.com/crazy-max/gotestlist/gotestlist_test.go
main           TestDirs      /home/crazy/src/github.com/crazy-max/gotestlist/cmd/gotestlist/gotestlist_test.go

$ gotestlist github.com/crazy-max/gotestlist
gotestlist     TestTests     /home/crazy/src/github.com/crazy-max/gotestlist/gotestlist_test.go

$ gotestlist github.com/crazy-max/gotestlist/...
gotestlist     TestTests     /home/crazy/src/github.com/crazy-max/gotestlist/gotestlist_test.go
main           TestDirs      /home/crazy/src/github.com/crazy-max/gotestlist/cmd/gotestlist/gotestlist_test.go

$ gotestlist github.com/crazy-max/gotestlist github.com/crazy-max/gotestlist/cmd/gotestlist
gotestlist     TestTests     /home/crazy/src/github.com/crazy-max/gotestlist/gotestlist_test.go
main           TestDirs      /home/crazy/src/github.com/crazy-max/gotestlist/cmd/gotestlist/gotestlist_test.go

$ gotestlist -f json ./... | jq
[
  {
    "name": "TestTests",
    "benchmark": false,
    "fuzz": false,
    "suite": "",
    "file": "/home/crazy/src/github.com/crazy-max/gotestlist/gotestlist_test.go",
    "pkg": "gotestlist"
  },
  {
    "name": "TestDirs",
    "benchmark": false,
    "fuzz": false,
    "suite": "",
    "file": "/home/crazy/src/github.com/crazy-max/gotestlist/cmd/gotestlist/gotestlist_test.go",
    "pkg": "main"
  }
]

$ gotestlist -f "Pkg: {{.Pkg}} | TestName: {{.Name}} | File: {{.File}}" ./...
Pkg:     gotestlist     |     TestName:     TestTests     |     File:     /home/crazy/src/github.com/crazy-max/gotestlist/gotestlist_test.go
Pkg:     main           |     TestName:     TestDirs      |     File:     /home/crazy/src/github.com/crazy-max/gotestlist/cmd/gotestlist/gotestlist_test.go

$ gotestlist -d 1 ./...
["TestDirs|TestTests"]

$ gotestlist -d 2 ./...
["TestDirs","TestTests"]

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by becoming a sponsor on GitHub or by making a Paypal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.

GitHub

View Github