提交 6be01365 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

support cppunit

上级 a334b1f2
......@@ -282,12 +282,12 @@ type CppUnitSuites struct {
}
type CppUnitTest struct {
Id int `json:"id" xml:"Id,attr"`
Title string `json:"name" xml:"Name,innerxml"`
FailureType string `json:"failureType" xml:"FailureType,innerxml"`
Message string `json:"message" xml:"Message,innerxml"`
Title string `json:"name" xml:"Name"`
FailureType string `json:"failureType" xml:"FailureType"`
Message string `json:"message" xml:"Message"`
Location []struct {
File string `json:"file" xml:"File,innerxml"`
Line string `json:"line" xml:"Line,innerxml"`
File string `json:"file" xml:"File"`
Line string `json:"line" xml:"Line"`
} `json:"location" xml:"Location"`
Duration int
......
......@@ -79,6 +79,8 @@ func RetrieveUnitResult() []model.UnitTestSuite {
testSuite = ConvertGTestResult(gTestSuite)
}
} else if vari.UnitTestType == "cppunit" {
content = strings.Replace(content, "ISO-8859-1", "UTF-8", -1)
cppUnitSuites := model.CppUnitSuites{}
err = xml.Unmarshal([]byte(content), &cppUnitSuites)
if err == nil {
......
......@@ -161,7 +161,11 @@ func run(args []string) {
// junit -p 1 mvn clean package test
vari.UnitTestType = args[2]
flagSet.Parse(args[3:8])
end := 8
if end > len(args) - 1 {
end = len(args) - 1
}
flagSet.Parse(args[3:end])
start := 3
if vari.UnitTestResult != "" {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册