testing

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIndentingWriter

func NewIndentingWriter(w io.Writer) indentingWriter

Types

type PrettyReporter

type PrettyReporter struct {
	Output  io.Writer
	Verbose bool
}

PrettyReporter reports test results in a simple human readable format.

func (PrettyReporter) Report

func (r PrettyReporter) Report(result *TestResult) error

Report prints the test report to the reporter's output.

type Reporter

type Reporter interface {
	// Report is called with a channel that will contain test results.
	Report(result *TestResult) error
}

Reporter defines the interface for reporting test results.

func DefaultReporter

func DefaultReporter(output io.Writer) Reporter

type TestCaseInfo

type TestCaseInfo struct {
	Name       string
	Duration   uint64
	LogMessage string
	ErrMessage string
}

func (*TestCaseInfo) Fail

func (t *TestCaseInfo) Fail() bool

func (*TestCaseInfo) Format

func (t *TestCaseInfo) Format() string

func (*TestCaseInfo) Pass

func (t *TestCaseInfo) Pass() bool

func (*TestCaseInfo) Skip

func (t *TestCaseInfo) Skip() bool

TODO

func (*TestCaseInfo) StatusString

func (t *TestCaseInfo) StatusString() string

type TestOptions

type TestOptions struct {
	PkgList   []string
	RunRegRxp string
	FailFast  bool
}

type TestResult

type TestResult struct {
	Info []TestCaseInfo
}

func Test

func Test(testOpts *TestOptions, opts ...kcl.Option) (TestResult, error)

Jump to

Keyboard shortcuts

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