failures not counted correctly in some cases.
Summary output added.
This commit is contained in:
+12
-8
@@ -39,8 +39,9 @@ type Test struct {
|
||||
Tests []*Test `xml:"testsuite,omitempty"`
|
||||
SystemOut string `xml:"system-out,omitempty"`
|
||||
|
||||
parent *Test
|
||||
t0 time.Time
|
||||
hasTests bool
|
||||
parent *Test
|
||||
t0 time.Time
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
@@ -121,7 +122,8 @@ func (testsuites *Testsuites) Start(t time.Time, pkg string) {
|
||||
|
||||
func (testsuites *Testsuites) Test(t time.Time, pkg string, test string) {
|
||||
// This can be a test suite as well
|
||||
testsuites.getTest(t, pkg, test)
|
||||
testobj := testsuites.getTest(t, pkg, test)
|
||||
testobj.hasTests = true
|
||||
}
|
||||
|
||||
func (testsuites *Testsuites) Output(t time.Time, pkg string, test string, output string) {
|
||||
@@ -153,12 +155,14 @@ func (testsuites *Testsuites) Skip(t time.Time, pkg string, test string) {
|
||||
|
||||
func (suite *Test) Complete() {
|
||||
suite.TestCount = 0
|
||||
suite.Failures = 0
|
||||
suite.Errors = 0
|
||||
suite.Disabled = 0
|
||||
suite.Skipped = 0
|
||||
if len(suite.Tests) > 0 {
|
||||
suite.Failures = 0
|
||||
suite.Errors = 0
|
||||
suite.Disabled = 0
|
||||
suite.Skipped = 0
|
||||
}
|
||||
|
||||
if len(suite.Tests) == 0 {
|
||||
if len(suite.Tests) == 0 && suite.hasTests {
|
||||
suite.TestCount = 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user