runner

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg Config, events chan<- TestEvent) error

Run executes `go test` and sends parsed events to the returned channel. The channel is closed when the process finishes or ctx is cancelled. cancel() must be called by the caller to release resources.

Types

type Config

type Config struct {
	Packages   []string
	Run        string
	ExtraFlags []string
	Dir        string
	Timeout    string
}

Config holds test run configuration

func DefaultConfig

func DefaultConfig() Config

type TestEvent

type TestEvent struct {
	Time    time.Time `json:"Time"`
	Action  string    `json:"Action"`
	Package string    `json:"Package"`
	Test    string    `json:"Test"`
	Elapsed float64   `json:"Elapsed"`
	Output  string    `json:"Output"`
}

TestEvent is a single event from `go test -json`

Jump to

Keyboard shortcuts

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