no more duplication of test suites.
Parsing the test tree and deciding in the marsheller whether it is a testcase (leaf) or a suite (non-leaf)
This commit is contained in:
@@ -9,8 +9,43 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func main() {
|
||||
func (t *Test) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
if len(t.Tests) == 0 {
|
||||
start.Name = xml.Name{Local: "testcase"}
|
||||
classname := ""
|
||||
if t.Parent != nil {
|
||||
classname = t.Parent.Name
|
||||
}
|
||||
var skipped *Result
|
||||
if t.Skipped > 0 {
|
||||
skipped = &Result{
|
||||
Message: "skipped",
|
||||
}
|
||||
}
|
||||
var failed *Result
|
||||
if t.Failures > 0 {
|
||||
failed = &Result{
|
||||
Message: "failed",
|
||||
}
|
||||
}
|
||||
tc := Testcase{
|
||||
Name: t.Name,
|
||||
// parent class name
|
||||
Classname: classname,
|
||||
Time: t.Time,
|
||||
Skipped: skipped,
|
||||
Error: nil,
|
||||
Failure: failed,
|
||||
SystemOut: t.SystemOut,
|
||||
}
|
||||
return e.EncodeElement(tc, start)
|
||||
}
|
||||
type Alias Test
|
||||
start.Name = xml.Name{Local: "testsuite"}
|
||||
return e.EncodeElement(Alias(*t), start)
|
||||
}
|
||||
|
||||
func main() {
|
||||
/*
|
||||
testsuites := Testsuites{
|
||||
Time: 1.23,
|
||||
|
||||
Reference in New Issue
Block a user