Documentation
¶
Index ¶
- Variables
- func Bluef(msg string, args ...interface{}) string
- func BrightBluef(msg string, args ...interface{}) string
- func BrightCyanf(msg string, args ...interface{}) string
- func BrightF(msg string, args ...interface{}) string
- func BrightGrayf(msg string, args ...interface{}) string
- func BrightGreenf(msg string, args ...interface{}) string
- func BrightMagentaf(msg string, args ...interface{}) string
- func BrightWhitef(msg string, args ...interface{}) string
- func BrightYellowf(msg string, args ...interface{}) string
- func ColorOff()
- func Cyanf(msg string, args ...interface{}) string
- func DarkF(msg string, args ...interface{}) string
- func DarkWhitef(msg string, args ...interface{}) string
- func Grayf(msg string, args ...interface{}) string
- func Greenf(msg string, args ...interface{}) string
- func LightBluef(msg string, args ...interface{}) string
- func LightCyanf(msg string, args ...interface{}) string
- func LightGrayf(msg string, args ...interface{}) string
- func LightGreenf(msg string, args ...interface{}) string
- func LightMagentaf(msg string, args ...interface{}) string
- func LightRedf(msg string, args ...interface{}) string
- func LightWhitef(msg string, args ...interface{}) string
- func LightYellowf(msg string, args ...interface{}) string
- func Magentaf(msg string, args ...interface{}) string
- func Redf(msg string, args ...interface{}) string
- func StripSecrets(text string) string
- func Yellowf(msg string, args ...interface{}) string
- type JUnitFailure
- type JUnitProperty
- type JUnitSkipMessage
- type JUnitTestCase
- type JUnitTestSuite
- type JUnitTestSuites
- type Progress
- type TestResults
- func (c *TestResults) Append(other *TestResults)
- func (c *TestResults) Assert(name string, expect, actual interface{})
- func (c *TestResults) Debugf(s string, args ...interface{})
- func (c *TestResults) Done()
- func (c *TestResults) Errorf(s string, args ...interface{})
- func (c *TestResults) Failf(name, msg string, args ...interface{})
- func (c *TestResults) Infof(s string, args ...interface{})
- func (c *TestResults) Passf(name, msg string, args ...interface{})
- func (c *TestResults) Printf(s string, args ...interface{})
- func (c *TestResults) Println(s string)
- func (c *TestResults) Retry()
- 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)
- func (c *TestResults) Tracef(s string, args ...interface{})
- func (c *TestResults) Warnf(s string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
var ( Light = ";1m" Bright = ";40m" Normal = "m" Reset = "\x1b[0m" LightYellow = yellow + Light Red = red + Normal Yellow = yellow + Normal Gray = gray + Normal LightGray = gray + Light BrightGray = gray + Bright LightRed = red + Light Green = green + Normal LightGreen = green + Light BrightYellow = yellow + Bright Blue = blue + Normal LightBlue = blue + Light Magenta = magenta + Normal LightMagenta = magenta + Light BrightMagenta = magenta + Bright Cyan = cyan + Normal LightCyan = cyan + Light BrightCyan = cyan + Bright White = white + Light BoldOn = "\x1b[1m" BoldOff = "\x1b[22m" DarkWhite = "\x1b[38;5;244m" BrightWhite = "\x1b[38;5;244m" )
Functions ¶
func BrightBluef ¶ added in v1.5.1
BrightBluef prints and formats msg as red text
func BrightCyanf ¶ added in v1.5.1
LightCyanf prints and formats msg as light cyan text
func BrightGrayf ¶ added in v1.5.1
BrightGrayf prints and formats msg as red text
func BrightGreenf ¶ added in v1.5.1
BrightGreenf prints and formats msg as light green text
func BrightMagentaf ¶ added in v1.5.1
Magentaf prints and formats msg as green text
func BrightWhitef ¶ added in v1.5.1
DarkWhitef prints and formats msg as dark white
func BrightYellowf ¶ added in v1.5.1
BrightYellowf prints and formats msg as red text
func DarkWhitef ¶ added in v1.5.1
DarkWhitef prints and formats msg as dark white
func LightBluef ¶ added in v1.5.1
LightBluef prints and formats msg as red text
func LightCyanf ¶
LightCyanf prints and formats msg as light cyan text
func LightGrayf ¶ added in v1.5.1
LightGrayf prints and formats msg as red text
func LightGreenf ¶
LightGreenf prints and formats msg as light green text
func LightMagentaf ¶ added in v1.5.1
Magentaf prints and formats msg as green text
func LightWhitef ¶ added in v1.5.1
DarkWhitef prints and formats msg as dark white
func LightYellowf ¶ added in v1.5.1
LightYellowf prints and formats msg as red 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 Progress ¶ added in v1.2.0
type Progress interface { Done() Status(status string) Start() }
func NewTextProgress ¶ added in v1.2.0
func NewTextProgress(name string, localTest *TestResults) Progress
type TestResults ¶
type TestResults struct { PassCount int FailCount int SkipCount int Tests []JUnitTestCase Name string Writer io.Writer Retries int }
TestResults contains the status of testing
func NewTestResults ¶ added in v1.2.0
func NewTestResults(name string, writer io.Writer) TestResults
func (*TestResults) Append ¶ added in v1.2.0
func (c *TestResults) Append(other *TestResults)
func (*TestResults) Assert ¶ added in v1.5.1
func (c *TestResults) Assert(name string, expect, actual interface{})
func (*TestResults) Debugf ¶ added in v1.2.0
func (c *TestResults) Debugf(s string, args ...interface{})
func (*TestResults) Errorf ¶ added in v1.2.0
func (c *TestResults) Errorf(s string, args ...interface{})
func (*TestResults) Failf ¶
func (c *TestResults) Failf(name, msg string, args ...interface{})
Failf reports a new failing test
func (*TestResults) Infof ¶ added in v1.2.0
func (c *TestResults) Infof(s string, args ...interface{})
func (*TestResults) Passf ¶
func (c *TestResults) Passf(name, msg string, args ...interface{})
Passf reports a new passing test
func (*TestResults) Printf ¶ added in v1.2.0
func (c *TestResults) Printf(s string, args ...interface{})
func (*TestResults) Println ¶ added in v1.2.0
func (c *TestResults) Println(s string)
func (*TestResults) Retry ¶ added in v1.2.0
func (c *TestResults) Retry()
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)
func (*TestResults) Tracef ¶ added in v1.2.0
func (c *TestResults) Tracef(s string, args ...interface{})
func (*TestResults) Warnf ¶ added in v1.2.0
func (c *TestResults) Warnf(s string, args ...interface{})