junit

package
v2.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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