gotests

command
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

	-named                switch table tests from using slice to map (with test name for the key)

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

  -package_test         generate black-box tests in the external <pkg>_test package.
                        Implies -exported

  -nosubtests           disable generating tests using the Go 1.7 subtests feature

	-parallel             enable generating parallel subtests using the Go 1.7 feature

	-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

Directories

Path Synopsis
Package process is a thin wrapper around the gotests library.
Package process is a thin wrapper around the gotests library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL