Documentation
¶
Index ¶
- func Greenf(msg string, args ...interface{}) string
- func LightCyanf(msg string, args ...interface{}) string
- func LightGreenf(msg string, args ...interface{}) string
- func Redf(msg string, args ...interface{}) string
- func StripSecrets(text string) string
- type JUnitFailure
- type JUnitProperty
- type JUnitSkipMessage
- type JUnitTestCase
- type JUnitTestSuite
- type JUnitTestSuites
- type TestResults
- func (c *TestResults) Done()
- func (c *TestResults) Failf(name, msg string, args ...interface{})
- func (c *TestResults) Passf(name, msg string, args ...interface{})
- func (c *TestResults) Skipf(name, msg string, args ...interface{})
- func (c TestResults) String() string
- func (c *TestResults) SuiteName(name string) *TestResults
- func (c TestResults) ToXML() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LightCyanf ¶
LightCyanf prints and formats msg as light cyan text
func LightGreenf ¶
LightGreenf prints and formats msg as light green text
func StripSecrets ¶
StripSecrets takes a YAML or INI formatted text and removes any potentially secret data as denoted by keys containing "pass" or "secret" or exact matches for "key" the last character of the secret is kept to aid in troubleshooting
Types ¶
type JUnitFailure ¶
type JUnitFailure struct {
Message string `xml:"message,attr"`
Type string `xml:"type,attr"`
Contents string `xml:",chardata"`
}
JUnitFailure contains data related to a failed test.
type JUnitProperty ¶
JUnitProperty represents a key/value pair used to define properties.
type JUnitSkipMessage ¶
type JUnitSkipMessage struct {
Message string `xml:"message,attr"`
}
JUnitSkipMessage contains the reason why a testcase was skipped.
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"`
SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
Failure *JUnitFailure `xml:"failure,omitempty"`
}
JUnitTestCase is a single test case with its result.
type JUnitTestSuite ¶
type JUnitTestSuite struct {
XMLName xml.Name `xml:"testsuite"`
Tests int `xml:"tests,attr"`
Failures int `xml:"failures,attr"`
Time string `xml:"time,attr"`
Name string `xml:"name,attr"`
Properties []JUnitProperty `xml:"properties>property,omitempty"`
TestCases []JUnitTestCase `xml:"testcase"`
}
JUnitTestSuite is a single JUnit test suite which may contain many testcases.
type JUnitTestSuites ¶
type JUnitTestSuites struct {
XMLName xml.Name `xml:"testsuites"`
Suites []JUnitTestSuite `xml:"testsuite"`
}
JUnitTestSuites is a collection of JUnit test suites.
func (JUnitTestSuites) ToXML ¶
func (suites JUnitTestSuites) ToXML() (string, error)
type TestResults ¶
type TestResults struct {
PassCount int
FailCount int
SkipCount int
Tests []JUnitTestCase
Name string
}
TestResults contains the status of testing
func (*TestResults) Failf ¶
func (c *TestResults) Failf(name, msg string, args ...interface{})
Failf reports a new failing test
func (*TestResults) Passf ¶
func (c *TestResults) Passf(name, msg string, args ...interface{})
Passf reports a new passing test
func (*TestResults) Skipf ¶
func (c *TestResults) Skipf(name, msg string, args ...interface{})
Skipf reports a new skipped test
func (TestResults) String ¶
func (c TestResults) String() string
func (*TestResults) SuiteName ¶
func (c *TestResults) SuiteName(name string) *TestResults
func (TestResults) ToXML ¶
func (c TestResults) ToXML() (string, error)