gotests: github.com/cweill/gotests/gotests Files | Directories

Command gotests

A commandline tool for generating table-driven Go tests.

This tool can generate tests for specific Go source files or an entire directory. By default, it prints its output to stdout.

Usage:

$ gotests [options] PATH ...

Available options:

-all                  generate tests for all functions and methods

-excl                 regexp. generate tests for functions and methods that don't
                      match. Takes precedence over -only, -exported, and -all

-exported             generate tests for exported functions and methods. Takes
                      precedence over -only and -all

-i                    print test inputs in error messages

-only                 regexp. generate tests for functions and methods that match only.
                      Takes precedence over -all

-nosubtests           disable subtest generation when >= Go 1.7

-parallel             enable parallel subtest generation when >= Go 1.7.

-w                    write output to (test) files instead of stdout

-template_dir         Path to a directory containing custom test code templates. Takes
                      precedence over -template. This can also be set via environment
                      variable GOTESTS_TEMPLATE_DIR

-template             Specify custom test code templates, e.g. testify. This can also
                      be set via environment variable GOTESTS_TEMPLATE

-template_params_file read external parameters to template by json with file

-template_params	   read external parameters to template by json with stdin

Package Files

main.go subtests.go

Directories

PathSynopsis
processPackage process is a thin wrapper around the gotests library.

Package main imports 3 packages (graph). Updated 2020-04-20. Refresh now. Tools for package owners.