tests

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Summary

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

func NewSummary

func NewSummary() *Summary

func (*Summary) AddPackage

func (s *Summary) AddPackage(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() *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) []string

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)

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"`
	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
	Running int
}

Jump to

Keyboard shortcuts

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