tests

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareTestNode added in v0.10.0

func CompareTestNode(a, b *TestNode) int

Types

type Summary

type Summary struct {
	// contains filtered or unexported fields
}

func NewSummary

func NewSummary() *Summary

func (*Summary) AddToPackage added in v0.11.0

func (s *Summary) AddToPackage(pkg string, status string)

func (*Summary) PackageSummary

func (s *Summary) PackageSummary() TestSummary

func (*Summary) Total

func (s *Summary) Total() TestSummary

type TestManager

type TestManager struct {
	// contains filtered or unexported fields
}

func NewTestManager

func NewTestManager(opts TestManagerOpts) *TestManager

func (*TestManager) AddTestOutput

func (tm *TestManager) AddTestOutput(testOutput TestOutputLine)

func (*TestManager) GetLogCount added in v0.2.0

func (tm *TestManager) GetLogCount(testRef TestReference) int

func (*TestManager) GetLogs

func (tm *TestManager) GetLogs(testRef TestReference) []logparse.LogEntry

func (*TestManager) GetTest

func (tm *TestManager) GetTest(index int) *TestNode

func (*TestManager) GetTestCount

func (tm *TestManager) GetTestCount() int

func (*TestManager) GetTests

func (tm *TestManager) GetTests(yield func(int, *TestNode) bool)

func (*TestManager) ScanStdin added in v0.12.2

func (tm *TestManager) ScanStdin(ctx context.Context, reader io.Reader) error

type TestManagerOpts added in v0.7.0

type TestManagerOpts struct {
	ParseLogs bool
}

type TestNode

type TestNode struct {
	Ref     TestReference
	Elapsed time.Duration
	Status  string // pass, fail, run
}

type TestOutputLine

type TestOutputLine struct {
	Time       time.Time `json:"Time"`
	Action     string    `json:"Action"`
	Package    string    `json:"Package"`
	ImportPath string    `json:"ImportPath,omitempty"`
	Test       string    `json:"Test,omitempty"`
	Elapsed    float64   `json:"Elapsed,omitempty"`
	Output     string    `json:"output,omitempty"`
}

JSON output from `go test -json`

type TestReference

type TestReference struct {
	Package string
	Test    string
}

type TestSummary

type TestSummary struct {
	Passed  int
	Failed  int
	Skipped int
	Running int
}

Jump to

Keyboard shortcuts

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