gotests: github.com/cweill/gotests/gotests/process Index | Files

package process

import "github.com/cweill/gotests/gotests/process"

Package process is a thin wrapper around the gotests library. It is intended to be called from a binary and handle its arguments, flags, and output when generating tests.

Index

Package Files

process.go

func Run Uses

func Run(out io.Writer, args []string, opts *Options)

Generates tests for the Go files defined in args with the given options. Logs information and errors to out. By default outputs generated tests to out unless specified by opt.

type Options Uses

type Options struct {
    OnlyFuncs          string // Regexp string for filter matches.
    ExclFuncs          string // Regexp string for excluding matches.
    ExportedFuncs      bool   // Only include exported functions.
    AllFuncs           bool   // Include all non-tested functions.
    PrintInputs        bool   // Print function parameters as part of error messages.
    Subtests           bool   // Print tests using Go 1.7 subtests
    Parallel           bool   // Print tests that runs the subtests in parallel.
    WriteOutput        bool   // Write output to test file(s).
    Template           string // Name of custom template set
    TemplateDir        string // Path to custom template set
    TemplateParamsPath string // Path to custom parameters json file(s).
}

Set of options to use when generating tests.

Package process imports 7 packages (graph) and is imported by 3 packages. Updated 2020-04-17. Refresh now. Tools for package owners.