parser

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Benchmark

type Benchmark struct {
	Name     string
	Duration time.Duration
	// number of B/op
	Bytes int
	// number of allocs/op
	Allocs int
}

Benchmark contains the results of a single benchmark.

type Package

type Package struct {
	Name        string
	Duration    time.Duration
	Tests       []*Test
	Benchmarks  []*Benchmark
	CoveragePct string

	// Time is deprecated, use Duration instead.
	Time int // in milliseconds
}

Package contains the test results of a single package.

type Report

type Report struct {
	Packages []Package
}

Report is a collection of package tests.

func Parse

func Parse(r io.Reader, pkgName string, ignoreParents bool) (*Report, error)

Parse parses go test output from reader r and returns a report with the results. An optional pkgName can be given, which is used in case a package result line is missing.

func (*Report) Failures

func (r *Report) Failures() int

Failures counts the number of failed tests in this report

type Result

type Result int

Result represents a test result.

const (
	PASS Result = iota
	FAIL
	SKIP
	ERROR
)

Test result constants

type Test

type Test struct {
	Name     string
	Duration time.Duration
	Result   Result
	Output   []string

	SubtestIndent string

	// Time is deprecated, use Duration instead.
	Time int // in milliseconds
}

Test contains the results of a single test.

Jump to

Keyboard shortcuts

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