process

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 7 Imported by: 35

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

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

Run generates tests for the Go files defined in args with the given options. It logs information and errors to out. By default, it outputs generated tests to out unless WriteOutput is specified in opts.

Types

type Options

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.
	Named              bool     // Create Map instead of slice
	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).
	TemplateParams     string   // Custom parameters as JSON string
	TemplateData       [][]byte // Data slice for templates
	UseGoCmp           bool     // Use cmp.Equal (google/go-cmp) instead of reflect.DeepEqual
	UseAI              bool     // Generate test cases using AI
	AIModel            string   // AI model to use
	AIEndpoint         string   // AI API endpoint
	AIMinCases         int      // Minimum number of test cases to generate
	AIMaxCases         int      // Maximum number of test cases to generate
}

Options contains command-line configuration for generating tests.

Jump to

Keyboard shortcuts

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