diff --git a/src/model/testing.go b/src/model/testing.go index 8ce23ed7497c719dfdfe2399a80e2c0822e7266e..63261c6b4f2725c74442b70188d7d4fd1a959074 100644 --- a/src/model/testing.go +++ b/src/model/testing.go @@ -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 diff --git a/src/service/testing/unitTestResult.go b/src/service/testing/unitTestResult.go index ae378f0d45a7c24012a52b1077870b60fb956ceb..6b709af454075fdb94220346a3723049fc480ef4 100644 --- a/src/service/testing/unitTestResult.go +++ b/src/service/testing/unitTestResult.go @@ -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 { diff --git a/src/ztf.go b/src/ztf.go index 1371e3d5505cdefa47c4a3ca324600316c7a50b2..1381e7356b2abb28a8cffc41e444591a102b51cc 100644 --- a/src/ztf.go +++ b/src/ztf.go @@ -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 != "" {