reporter

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package reporter provides test result reporters. It is intended to be used in scenarigo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(f func(r Reporter), opts ...Option) bool

Run runs f with new Reporter which applied opts. It reports whether f succeeded.

Types

type Option

type Option func(*testContext)

Option represents an option for test reporter.

func WithMaxParallel

func WithMaxParallel(i int) Option

WithMaxParallel returns an option to set the number of parallel.

func WithVerboseLog

func WithVerboseLog() Option

WithVerboseLog returns an option to enable verbose log.

func WithWriter

func WithWriter(w io.Writer) Option

WithWriter returns an option to set the writer.

type Reporter

type Reporter interface {
	Name() string
	Fail()
	Failed() bool
	FailNow()
	Log(args ...interface{})
	Logf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Skip(args ...interface{})
	Skipf(format string, args ...interface{})
	SkipNow()
	Skipped() bool
	Parallel()
	Run(name string, f func(r Reporter)) bool
}

A Reporter is something that can be used to report test results.

func FromT

func FromT(t *testing.T) Reporter

FromT creates Reporter from t.

Jump to

Keyboard shortcuts

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