formatter

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JUnitFailure

type JUnitFailure struct {
	Message  string `xml:"message,attr"`
	Type     string `xml:"type,attr"`
	Contents string `xml:",cdata"`
}

JUnitFailure contains data related to a failed test.

type JUnitFormatter

type JUnitFormatter struct {
	Suites     JUnitTestSuites
	OnlyFailed bool
}

JUnitFormatter is a formatter for JUnit XML.

func (*JUnitFormatter) OpenTest

func (f *JUnitFormatter) OpenTest(test *test.Test)

OpenTest implements prove.Formatter

func (*JUnitFormatter) Report

func (f *JUnitFormatter) Report() error

Report implements prove.Formatter

type JUnitProperty

type JUnitProperty struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

JUnitProperty represents a key/value pair used to define properties.

type JUnitSkipMessage

type JUnitSkipMessage struct {
	Message string `xml:"message,attr"`
}

JUnitSkipMessage contains the reason why a testcase was skipped.

type JUnitSystemErr

type JUnitSystemErr struct {
	Contents string `xml:",cdata"`
}

JUnitSystemErr contains the standard error.

type JUnitSystemOut

type JUnitSystemOut struct {
	Contents string `xml:",cdata"`
}

JUnitSystemOut contains the standard out.

type JUnitTestCase

type JUnitTestCase struct {
	XMLName     xml.Name          `xml:"testcase"`
	Classname   string            `xml:"classname,attr"`
	Name        string            `xml:"name,attr"`
	Time        string            `xml:"time,attr"`
	SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
	Failure     *JUnitFailure     `xml:"failure,omitempty"`
	SystemOut   *JUnitSystemOut   `xml:"system-out,omitempty"`
	SystemErr   *JUnitSystemErr   `xml:"system-err,omitempty"`
}

JUnitTestCase is a single test case with its result.

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName    xml.Name        `xml:"testsuite"`
	Tests      int             `xml:"tests,attr"`
	Failures   int             `xml:"failures,attr"`
	Errors     int             `xml:"errors,attr"`
	Skipped    int             `xml:"skipped,attr"`
	Time       string          `xml:"time,attr"`
	Name       string          `xml:"name,attr"`
	Properties []JUnitProperty `xml:"properties>property,omitempty"`
	TestCases  []JUnitTestCase
}

JUnitTestSuite is a single JUnit test suite which may contain many testcases.

type JUnitTestSuites

type JUnitTestSuites struct {
	XMLName xml.Name `xml:"testsuites"`
	Suites  []JUnitTestSuite
}

JUnitTestSuites is a collection of JUnit test suites.

type TapFormatter

type TapFormatter struct {
	Suites []*tap.Testsuite
}

TapFormatter formats the test result into TAP https://testanything.org/

func (*TapFormatter) OpenTest

func (f *TapFormatter) OpenTest(test *test.Test)

OpenTest implements prove.Formatter

func (*TapFormatter) Report

func (f *TapFormatter) Report() error

Report implements prove.Formatter

Jump to

Keyboard shortcuts

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