junit

package
v2.21.4-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteReport

func WriteReport(w io.Writer, data *gosec.ReportInfo) error

WriteReport write a report in JUnit format to the output writer

Types

type Failure

type Failure struct {
	XMLName xml.Name `xml:"failure"`
	Message string   `xml:"message,attr"`
	Text    string   `xml:",innerxml"`
}

Failure defines a JUnit failure

func NewFailure

func NewFailure(message string, text string) *Failure

NewFailure instantiate a Failure

type Report

type Report struct {
	XMLName    xml.Name     `xml:"testsuites"`
	Testsuites []*Testsuite `xml:"testsuite"`
}

Report defines a JUnit XML report

func GenerateReport

func GenerateReport(data *gosec.ReportInfo) Report

GenerateReport Convert a gosec report to a JUnit Report

type Testcase

type Testcase struct {
	XMLName xml.Name `xml:"testcase"`
	Name    string   `xml:"name,attr"`
	Failure *Failure `xml:"failure"`
}

Testcase defines a JUnit testcase

func NewTestcase

func NewTestcase(name string, failure *Failure) *Testcase

NewTestcase instantiate a Testcase

type Testsuite

type Testsuite struct {
	XMLName   xml.Name    `xml:"testsuite"`
	Name      string      `xml:"name,attr"`
	Tests     int         `xml:"tests,attr"`
	Testcases []*Testcase `xml:"testcase"`
}

Testsuite defines a JUnit testsuite

func NewTestsuite

func NewTestsuite(name string) *Testsuite

NewTestsuite instantiate a Testsuite

Jump to

Keyboard shortcuts

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