format

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Output

type Output struct {
	Index int    `json:"index"`
	Text  string `json:"text"`
}

type Test

type Test struct {
	Parent    *Test         `json:"-"`
	Index     int           `json:"index"`
	StartedAt Time          `json:"started_at"`
	EndedAt   Time          `json:"ended_at"`
	FullName  string        `json:"full_name"`
	Package   string        `json:"package"`
	Output    []*Output     `json:"output"`
	Done      bool          `json:"done"`
	Skipped   bool          `json:"skipped"`
	Passed    bool          `json:"passed"`
	Elapsed   time.Duration `json:"elapsed"`
	Tests     []*Test       `json:"tests"`
}

func (*Test) FullOutput

func (t *Test) FullOutput() *bytes.Buffer

func (*Test) Name

func (t *Test) Name() string

type TestAction

type TestAction string
const (
	// The test binary is about to be executed
	TestActionStart TestAction = "start"
	// The test has started running
	TestActionRun TestAction = "run"
	// The test has been paused
	TestActionPause TestAction = "pause"
	// The test has continued running
	TestActionCont TestAction = "cont"
	// The test passed
	TestActionPass TestAction = "pass"
	// The benchmark printed log output but did not fail
	TestActionBench TestAction = "bench"
	// The test or benchmark failed
	TestActionFail TestAction = "fail"
	// The test printed output
	TestActionOutput TestAction = "output"
	// The test was skipped or the package contained no tests
	TestActionSkip TestAction = "skip"
)

type TestCapture

type TestCapture struct {
	Tests            []*Test `json:"tests"`
	Title            string  `json:"title"`
	StartedAt        Time    `json:"started_at"`
	EndedAt          Time    `json:"ended_at"`
	CaptureStartedAt Time    `json:"capture_started_at"`
	CaptureEndedAt   Time    `json:"capture_ended_at"`
	// contains filtered or unexported fields
}

func Read

func Read(r io.Reader, emulate bool) (*TestCapture, error)

TODO: When reading from stdin, make this write to disk and seek instead of keeping everything in-memory

type TestEvent

type TestEvent struct {
	Time    Time
	Action  TestAction
	Package string
	Test    string
	Elapsed float64
	Output  string
}

func (*TestEvent) Duration

func (e *TestEvent) Duration() time.Duration

func (*TestEvent) ParentTest added in v0.2.1

func (e *TestEvent) ParentTest() string

type Time

type Time time.Time

func (Time) MarshalText added in v0.2.0

func (t Time) MarshalText() ([]byte, error)

func (*Time) UnmarshalText

func (t *Time) UnmarshalText(text []byte) (err error)

Jump to

Keyboard shortcuts

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