junitxml

package
v0.0.0-...-d16bdc6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package junitxml provides helpers around creating junit XML data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestCase

type TestCase struct {
	Classname string        `xml:"classname,attr"`
	ID        string        `xml:"id,attr"`
	Name      string        `xml:"name,attr"`
	Time      float64       `xml:"time,attr"`
	Skipped   *junitSkipped `xml:"skipped,omitempty"`
	Failure   *junitFailure `xml:"failure,omitempty"`
	SystemOut string        `xml:"system-out,omitempty"`
	// contains filtered or unexported fields
}

TestCase is a junitxml TestCase.

func NewTestCase

func NewTestCase(classname, name string) *TestCase

NewTestCase creates a new TestCase.

func (*TestCase) FilterTestCase

func (c *TestCase) FilterTestCase(regex *regexp.Regexp) bool

FilterTestCase markes a TestCase as skipped if the name matches does not match the regex.

func (*TestCase) Finish

func (c *TestCase) Finish(tests chan *TestCase)

Finish marks a TestCase as finished and sends it in the provided channel.

func (*TestCase) Logf

func (c *TestCase) Logf(msg string, args ...interface{})

Logf logs to the TestCase SystemOut.

func (*TestCase) WriteFailure

func (c *TestCase) WriteFailure(msg string, args ...interface{})

WriteFailure marks a TestCase as failed with the provided message.

func (*TestCase) WriteSkipped

func (c *TestCase) WriteSkipped(msg string, args ...interface{})

WriteSkipped marks a TestCase as skipped with the provided message.

type TestSuite

type TestSuite struct {
	XMLName  xml.Name `xml:"testsuite"`
	Name     string   `xml:"name,attr"`
	Tests    int      `xml:"tests,attr"`
	Failures int      `xml:"failures,attr"`
	Errors   int      `xml:"errors,attr"`
	Disabled int      `xml:"disabled,attr"`
	Skipped  int      `xml:"skipped,attr"`
	Time     float64  `xml:"time,attr"`

	TestCase []*TestCase `xml:"testcase"`
	// contains filtered or unexported fields
}

TestSuite is a junitxml TestSuite.

func NewTestSuite

func NewTestSuite(name string) *TestSuite

NewTestSuite creates a new TestSuite.

func (*TestSuite) Finish

func (s *TestSuite) Finish(tests chan *TestSuite)

Finish marks a TestSuite as finished and sends it in the provided channel.

Jump to

Keyboard shortcuts

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