reintroducing nesting.

This commit is contained in:
Erik Brakkee 2024-11-20 23:35:05 +01:00
parent e0207bab2a
commit bfbf24a6c4

View File

@ -3,6 +3,7 @@ package main
import (
"encoding/xml"
"log"
"strings"
"time"
)
@ -82,7 +83,7 @@ func (suite *Testsuite) getSuite(t time.Time, name string) *Testsuite {
}
}
s := Testsuite{
Name: name,
Name: suite.Name + "/" + name,
Timestamp: t,
}
suite.Testsuites = append(suite.Testsuites, &s)
@ -90,10 +91,14 @@ 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])
//}
suitename := suite.Name
path := strings.Split(testname, "/")
for i := 0; i < len(path)-1; i++ {
suite = suite.getSuite(t, path[i])
suitename = suitename + "/" + path[i]
}
testname = path[len(path)-1]
for _, test := range suite.Testcases {
if test.Name == testname {
return test
@ -104,7 +109,7 @@ func (suite *Testsuite) getTest(t time.Time, testname string) *Testcase {
}
test := Testcase{
Name: testname,
Classname: suite.Name,
Classname: suitename,
}
suite.Testcases = append(suite.Testcases, &test)
return &test