junit

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: MIT Imports: 10 Imported by: 0

README

sweet-junit

A plugin for the Sweet testing framework to output JUnit files for test results

Usage

Using this plugin with sweet is pretty straightforward:

func Test(t *testing.T) {
    sweet.T(func(s *sweet.S) {
        s.RegisterPlugin(junit.NewPlugin())

        s.RunSuite(t, &mySuite{})
    })
}

Once the plugin is registered with sweet, you can specify the file to write the output to by passing the -sweet.opt when running go test and providing the junit.output key with the path you'd like to write the junit file to, such as:

$ go test -sweet.opt "junit.output=junit.xml"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JUnitPlugin

type JUnitPlugin struct {
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin() *JUnitPlugin

func (*JUnitPlugin) Finished

func (p *JUnitPlugin) Finished()

func (*JUnitPlugin) Name

func (p *JUnitPlugin) Name() string

func (*JUnitPlugin) Options

func (p *JUnitPlugin) Options() *sweet.PluginOptions

func (*JUnitPlugin) SetOption

func (p *JUnitPlugin) SetOption(name, value string)

func (*JUnitPlugin) Starting

func (p *JUnitPlugin) Starting()

func (*JUnitPlugin) SuiteFinished

func (p *JUnitPlugin) SuiteFinished(suite string, stats *sweet.SuiteFinishedStats)

func (*JUnitPlugin) SuiteStarting

func (p *JUnitPlugin) SuiteStarting(suite string)

func (*JUnitPlugin) TestFailed

func (p *JUnitPlugin) TestFailed(testName *sweet.TestName, stats *sweet.TestFailedStats)

func (*JUnitPlugin) TestPassed

func (p *JUnitPlugin) TestPassed(testName *sweet.TestName, stats *sweet.TestPassedStats)

func (*JUnitPlugin) TestSkipped

func (p *JUnitPlugin) TestSkipped(testName *sweet.TestName, stats *sweet.TestSkippedStats)

func (*JUnitPlugin) TestStarting

func (p *JUnitPlugin) TestStarting(testName *sweet.TestName)

Jump to

Keyboard shortcuts

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