Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCoverFile = coverage.DefaultCoverFile
	CoverLine        = coverage.ModeLine
	CoverFunc        = coverage.ModeFunc
	CoverFile        = coverage.ModeFile
)

The coverage vocabulary is the runner's; these names are what the test command's own code reads, so the two spell the same thing.

View Source
const (
	// CacheOff gives every fixture run its own caches and drops the runtime
	// after it. Nothing one run parsed is visible to the next, so a run is
	// charged the parsing its own includes cost - and what it held is returned
	// when it ends rather than kept for the length of the suite.
	CacheOff = "off"
	// CacheWorker gives each worker one set, reused by the fixtures that
	// worker runs serially. What is held scales with --parallel rather than
	// with the number of fixtures.
	CacheWorker = "worker"
)

The --cache modes, which say how far a parsed include and a compiled expression travel.

There is no "shared" mode because a worker loop already is one: run without --parallel there is a single worker, so a single set of caches serves the whole run. Sharing them across workers on top of that only adds contention for a hit the worker's own cache already has.

View Source
const Name = "Run .phpt test fixtures"

Name is the command title.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(cfg *config.Config, globals *flags.Options) *cli.Command

NewCommand creates a new test command.

func Run

func Run(ctx context.Context, args []string, opts Options) error

Run executes .phpt test fixtures matching the provided paths or patterns.

Types

type Options

type Options struct {
	Include   string
	JSON      bool
	Matrix    bool
	Verbose   bool
	Parallel  int
	Count     int
	Time      time.Duration
	Profile   bool
	Output    string
	Cover     string
	CoverFile string
	Split     bool
	SkipPHP   bool
	Cache     string

	// Config is what the run started with: the embedded defaults, with the
	// file -f named read over them. A phpscript.yml discovered in the fixture
	// tree is read over this one in turn.
	Config config.Config
	// contains filtered or unexported fields
}

Options holds CLI flag options for the test command. Include, Verbose, Cover and CoverFile are the shared flags, copied off internal/flags before the run so the report writers keep taking one struct.

Jump to

Keyboard shortcuts

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