reporters

package
v0.25.3-crie Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONReporter

type JSONReporter struct{}

JSONReporter prints failures as a single JSON struct, allowing for simple machine-readable output.

The format is:

 {
		"lints":
			[
				{"filename": FILENAME, "line": LINE, "column": COL, "message": MESSAGE, "rule": RULE}
			],
 }

func (JSONReporter) Report

func (r JSONReporter) Report(w io.Writer, fs []report.Failure) error

Report writes failures to w.

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 JUnitReporter

type JUnitReporter struct{}

JUnitReporter prints failures in JUnit XML format.

func (JUnitReporter) Report

func (r JUnitReporter) Report(w io.Writer, fs []report.Failure) error

Report writes failures to w.

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"`
	Failure   *JUnitFailure `xml:"failure,omitempty"`
}

JUnitTestCase is a single test case with its result.

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName   xml.Name `xml:"testsuite"`
	Package   string   `xml:"package"`
	Tests     int      `xml:"tests,attr"`
	Failures  int      `xml:"failures,attr"`
	Time      string   `xml:"time,attr"`
	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 PlainReporter

type PlainReporter struct{}

PlainReporter prints failures as it is.

func (PlainReporter) Report

func (r PlainReporter) Report(w io.Writer, fs []report.Failure) error

Report writes failures to w.

type UnixReporter

type UnixReporter struct{}

UnixReporter prints failures as it respects Unix output conventions those are frequently employed by preprocessors and compilers.

The format is "FILENAME:LINE:COL: MESSAGE".

func (UnixReporter) Report

func (r UnixReporter) Report(w io.Writer, fs []report.Failure) error

Report writes failures to w.

Jump to

Keyboard shortcuts

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