identify skipped tests properly with a message

This commit is contained in:
Peter Lacey-Bordeaux
2014-10-24 08:58:04 -04:00
parent 9922c23bd3
commit 5c1ba2f305
2 changed files with 18 additions and 6 deletions

View File

@ -20,11 +20,16 @@ type JUnitTestSuite struct {
}
type JUnitTestCase struct {
XMLName xml.Name `xml:"testcase"`
Classname string `xml:"classname,attr"`
Name string `xml:"name,attr"`
Time string `xml:"time,attr"`
Failure *JUnitFailure `xml:"failure,omitempty"`
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"`
}
type JUnitSkipMessage struct {
Message string `xml:"message,attr"`
}
type JUnitProperty struct {
@ -88,6 +93,10 @@ func JUnitReportXML(report *Report, w io.Writer) error {
}
}
if test.Result == SKIP {
testCase.SkipMessage = &JUnitSkipMessage{strings.Join(test.Output, "\n")}
}
ts.TestCases = append(ts.TestCases, testCase)
}