runner

package
Version: v0.0.0-...-b94c5f0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package runner implements test runner used by gophers tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailMode

type FailMode int

FailMode defines how early load test should fail if test fails.

const (
	// FailEarly terminates failed load test as fast as possible.
	FailEarly FailMode = iota

	// FailStep terminates failed load test before next load step.
	FailStep

	// FailContinue doesn't terminate failed load test.
	FailContinue
)

type Loader

type Loader interface {
	Count(duration time.Duration) int
	String() string
}

type Runner

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

Runner contains test functions.

func New

func New(suite string, l *log.Logger) *Runner

New creates new runner with given suite name and logger.

func (*Runner) Add

func (r *Runner) Add(name string, test TestFunc, weight int)

Add registers test function under given name.

func (*Runner) Load

func (r *Runner) Load(re *regexp.Regexp, seed int64, loader Loader, failMode FailMode) int

Load runs tests matching regexp in order defined by seed in load test mode. If seed is 0, tests are run sequentially. Otherwise, seed defines random order of tests.

func (*Runner) Test

func (r *Runner) Test(re *regexp.Regexp, seed int64) int

Test runs tests matching regexp in order defined by seed. If seed is 0, tests are run sequentially. Otherwise, seed defines random order of tests.

type StepLoader

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

func NewStepLoader

func NewStepLoader(minC uint, maxC uint, stepC uint, stepDuration time.Duration) (*StepLoader, error)

func (*StepLoader) Count

func (s *StepLoader) Count(duration time.Duration) int

func (*StepLoader) String

func (s *StepLoader) String() string

type TestFunc

type TestFunc func(gophers.TestingT)

TestFunc is a test function.

Jump to

Keyboard shortcuts

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