testreporter

package
v0.1.63 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testreporter provides the utilities to capture, report, and log test results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestResult

type TestResult struct {
	Name                string          `json:"name"`
	Method              string          `json:"method"`
	Args                [][]interface{} `json:"args"`
	Result              []interface{}   `json:"result"`
	Errors              []error         `json:"errors"`
	NumberOfTestsRan    int             `json:"numberOfTestsRan"`
	NumberOfTestsPassed int             `json:"numberOfTestsPassed"`
	NumberOfTestsFailed int             `json:"numberOfTestsFailed"`
}

func New

func New(testName string, testMethod string, numOfTestRuns int) TestResult

func (*TestResult) Fail

func (tr *TestResult) Fail(args []interface{}, result interface{}, err error)

func (*TestResult) Pass

func (tr *TestResult) Pass(args []interface{}, result interface{}, err error)

type TestResults

type TestResults struct {
	Tests       []TestResult
	TableWriter table.Writer
}

func (*TestResults) AddTestResult

func (trs *TestResults) AddTestResult(testResult TestResult)

func (*TestResults) ExportResultToCSV

func (trs *TestResults) ExportResultToCSV(filePath string)

func (*TestResults) ExportResultToHTML

func (trs *TestResults) ExportResultToHTML(filePath string)

func (*TestResults) ExportResultToJSON

func (trs *TestResults) ExportResultToJSON(filePath string)

func (*TestResults) ExportResultToMarkdown

func (trs *TestResults) ExportResultToMarkdown(filePath string)

func (*TestResults) GenerateTabularResult

func (trs *TestResults) GenerateTabularResult()

func (*TestResults) PrintSummary

func (trs *TestResults) PrintSummary()

func (*TestResults) PrintTabularResult

func (trs *TestResults) PrintTabularResult()

Jump to

Keyboard shortcuts

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