extension

package
v0.0.0-...-37536b8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: BSD-2-Clause Imports: 3 Imported by: 6

Documentation

Overview

Package extension contains the types for extending the core package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPanicError

func NewPanicError(o interface{}, skip int) error

NewPanicError returns a new PanicError. Object o is the panicking error, skip is the magic number to skip noise entries of stack trace.

func NewPendingError

func NewPendingError() error

NewPendingError returns a new PendingError.

Types

type FuncPos

type FuncPos struct {
	Name string
	File string
	Line int
	PC   uintptr
}

FuncPos represents a position in a stack trace.

type PanicError

type PanicError struct {
	Err   error
	Stack []FuncPos
	SS    []byte // TODO: if it is useful, parse it, otherwise, delete it.
}

PanicError wraps an error from panicking and its call stack trace.

func (*PanicError) Error

func (e *PanicError) Error() string

Error is the same as the panicking error.

type PendingError

type PendingError struct{}

PendingError is used for marking a test group without a test closure.

func (*PendingError) Error

func (*PendingError) Error() string

type Reporter

type Reporter interface {
	Start()                          // Start should be called before all tests start.
	End(group *TestGroup)            // End should be called after all tests end.
	Progress(g *TestGroup, s *Stats) // Progress should be called whenever the statistics change.
}

Reporter is a interface to accept events from tests running.

type Stats

type Stats struct {
	Total   int // Total number of test cases.
	Ended   int // Number of ended test cases.
	Failed  int // Number of failed test cases.
	Pending int // Number of pending test cases.
}

Stats contains statistics of tests running.

type TestGroup

type TestGroup struct {
	ID          string        // ID of the test group, used for focus mode.
	Description string        // Description of the test group.
	Error       error         // Error passed in during execution of the test group.
	Duration    time.Duration // Time duration of running the test group, set only to leaf node (test case).
	Children    TestGroups    // Children nested within the test groups.
}

A TestGroup contains a test group's related data.

func (*TestGroup) For

func (g *TestGroup) For(visit func(path TestGroups) bool) bool

For loops through each leaf node of a TestGroup. path contains the path from root to leaf.

type TestGroups

type TestGroups []*TestGroup

TestGroups is the type of slice of *TestGroup

Jump to

Keyboard shortcuts

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