Documentation ¶
Index ¶
- func SuitesString(suites []*TestSuite, prefix string) string
- type ExitError
- type FailureOutput
- type JUnitTestCase
- type JUnitTestSuite
- type JUnitTestSuites
- type MinimalReporter
- func (r *MinimalReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
- func (r *MinimalReporter) BeforeSuiteDidRun(setup *types.SetupSummary)
- func (r *MinimalReporter) Fail()
- func (r *MinimalReporter) SpecDidComplete(spec *types.SpecSummary)
- func (r *MinimalReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
- func (r *MinimalReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
- func (r *MinimalReporter) SpecWillRun(spec *types.SpecSummary)
- func (r *MinimalReporter) Summary() (*types.SpecSummary, *types.SetupSummary)
- type Options
- type SkipMessage
- type TestFunc
- type TestOptions
- type TestResult
- type TestSuite
- type TestSuiteProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SuitesString ¶
SuitesString returns a string with the provided suites formatted. Prefix is printed at the beginning of the output.
Types ¶
type FailureOutput ¶
type FailureOutput struct { XMLName xml.Name `xml:"failure"` // Message holds the failure message from the test Message string `xml:"message,attr"` // Output holds verbose failure output from the test Output string `xml:",chardata"` }
FailureOutput holds the output from a failing test
type JUnitTestCase ¶
type JUnitTestCase struct { XMLName xml.Name `xml:"testcase"` // Name is the name of the test case Name string `xml:"name,attr"` // Classname is an attribute set by the package type and is required Classname string `xml:"classname,attr,omitempty"` // Duration is the time taken in seconds to run the test Duration float64 `xml:"time,attr"` // SkipMessage holds the reason why the test was skipped SkipMessage *SkipMessage `xml:"skipped"` // FailureOutput holds the output from a failing test FailureOutput *FailureOutput `xml:"failure"` // SystemOut is output written to stdout during the execution of this test case SystemOut string `xml:"system-out,omitempty"` // SystemErr is output written to stderr during the execution of this test case SystemErr string `xml:"system-err,omitempty"` }
JUnitTestCase represents a jUnit test case
type JUnitTestSuite ¶
type JUnitTestSuite struct { XMLName xml.Name `xml:"testsuite"` // Name is the name of the test suite Name string `xml:"name,attr"` // NumTests records the number of tests in the TestSuite NumTests uint `xml:"tests,attr"` // NumSkipped records the number of skipped tests in the suite NumSkipped uint `xml:"skipped,attr"` // NumFailed records the number of failed tests in the suite NumFailed uint `xml:"failures,attr"` // Duration is the time taken in seconds to run all tests in the suite Duration float64 `xml:"time,attr"` // Properties holds other properties of the test suite as a mapping of name to value Properties []*TestSuiteProperty `xml:"properties,omitempty"` // TestCases are the test cases contained in the test suite TestCases []*JUnitTestCase `xml:"testcase"` // Children holds nested test suites Children []*JUnitTestSuite `xml:"testsuite"` }
TestSuite represents a single jUnit test suite, potentially holding child suites.
type JUnitTestSuites ¶
type JUnitTestSuites struct { XMLName xml.Name `xml:"testsuites"` // Suites are the jUnit test suites held in this collection Suites []*JUnitTestSuite `xml:"testsuite"` }
TestSuites represents a flat collection of jUnit test suites.
type MinimalReporter ¶
type MinimalReporter struct {
// contains filtered or unexported fields
}
func NewMinimalReporter ¶
func NewMinimalReporter(name string, location types.CodeLocation) *MinimalReporter
func (*MinimalReporter) AfterSuiteDidRun ¶
func (r *MinimalReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
func (*MinimalReporter) BeforeSuiteDidRun ¶
func (r *MinimalReporter) BeforeSuiteDidRun(setup *types.SetupSummary)
func (*MinimalReporter) Fail ¶
func (r *MinimalReporter) Fail()
func (*MinimalReporter) SpecDidComplete ¶
func (r *MinimalReporter) SpecDidComplete(spec *types.SpecSummary)
func (*MinimalReporter) SpecSuiteDidEnd ¶
func (r *MinimalReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
func (*MinimalReporter) SpecSuiteWillBegin ¶
func (r *MinimalReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
func (*MinimalReporter) SpecWillRun ¶
func (r *MinimalReporter) SpecWillRun(spec *types.SpecSummary)
func (*MinimalReporter) Summary ¶
func (r *MinimalReporter) Summary() (*types.SpecSummary, *types.SetupSummary)
type Options ¶
type Options struct { Parallelism int Timeout time.Duration JUnitDir string TestFile string OutFile string IncludeSuccessOutput bool Provider string Suites []*TestSuite DryRun bool Out, ErrOut io.Writer }
Options is used to run a suite of tests by invoking each test as a call to a child worker (the run-tests command).
type SkipMessage ¶
type SkipMessage struct { XMLName xml.Name `xml:"skipped"` // Message explains why the test was skipped Message string `xml:"message,attr,omitempty"` }
SkipMessage holds a message explaining why a test was skipped
type TestOptions ¶
TestOptions handles running a single test.
func (*TestOptions) Run ¶
func (opt *TestOptions) Run(args []string) error
type TestResult ¶
type TestResult string
TestResult is the result of a test case
const ( TestResultPass TestResult = "pass" TestResultSkip TestResult = "skip" TestResultFail TestResult = "fail" )
type TestSuite ¶
type TestSuite struct { Name string Description string Matches func(name string) bool // Init should be run once before a test in this suite is run. Not called by // methods in this package. Init func() error Parallelism int // The number of flakes that may occur before this test is marked as a failure. MaximumAllowedFlakes int TestTimeout time.Duration }
Click to show internal directories.
Click to hide internal directories.