junit

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

JUnit test reports

Documentation

Overview

Package junit provides simplified structures for JUnit test reports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message     string `xml:"message,attr"`
	Type        string `xml:"type,attr"`
	Description string `xml:"description,omitempty"`
}

type Failure

type Failure struct {
	Message     string `xml:"message,attr"`
	Type        string `xml:"type,attr"`
	Description string `xml:"description,omitempty"`
}

type Skipped

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

type TestCase

type TestCase struct {
	Name    string   `xml:"name,attr"`
	Status  string   `xml:"status,attr"`
	Time    int64    `xml:"time,attr" json:"-"`
	Skipped *Skipped `xml:"skipped,omitempty"`
	Error   *Error   `xml:"error,omitempty"`
	Failure *Failure `xml:"failure,omitempty"`

	Timestamp time.Time `xml:"-"`
	Suite     string    `xml:"-"`
	N         int       `xml:"-"`
	Type      string    `xml:"-"`

	// State is often test.State, which can be used to emit
	// computed values like elapsed time.
	//
	// This value isn't XML-serialized.
	State interface{} `xml:"-"`
	// contains filtered or unexported fields
}

func NewTestCase

func NewTestCase(name string) *TestCase

func (*TestCase) Finish

func (tc *TestCase) Finish(status string)

type TestSuite

type TestSuite struct {
	Name      string     `xml:"testsuite,attr"`
	Tests     int        `xml:"tests,attr"`
	Failures  int        `xml:"failures,attr"`
	Errors    int        `xml:"errors,attr"`
	TestCases []TestCase `xml:"testcase"`

	Time time.Time `xml:"-"`
}

func NewTestSuite

func NewTestSuite() *TestSuite

func (*TestSuite) Add

func (ts *TestSuite) Add(tc TestCase)

Jump to

Keyboard shortcuts

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