now using classname in testcases to refer to the testsuite
This commit is contained in:
parent
37f4359dcb
commit
e0207bab2a
@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"encoding/xml"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -91,20 +90,21 @@ func (suite *Testsuite) getSuite(t time.Time, name string) *Testsuite {
|
||||
}
|
||||
|
||||
func (suite *Testsuite) getTest(t time.Time, testname string) *Testcase {
|
||||
path := strings.Split(testname, "/")
|
||||
for i := 0; i < len(path)-1; i++ {
|
||||
suite = suite.getSuite(t, path[i])
|
||||
}
|
||||
//path := strings.Split(testname, "/")
|
||||
//for i := 0; i < len(path)-1; i++ {
|
||||
// suite = suite.getSuite(t, path[i])
|
||||
//}
|
||||
for _, test := range suite.Testcases {
|
||||
if test.Name == path[len(path)-1] {
|
||||
if test.Name == testname {
|
||||
return test
|
||||
}
|
||||
}
|
||||
if path[len(path)-1] == "" {
|
||||
if testname == "" {
|
||||
panic("Empty testcase")
|
||||
}
|
||||
test := Testcase{
|
||||
Name: path[len(path)-1],
|
||||
Name: testname,
|
||||
Classname: suite.Name,
|
||||
}
|
||||
suite.Testcases = append(suite.Testcases, &test)
|
||||
return &test
|
||||
|
Loading…
Reference in New Issue
Block a user