()
| 315 | } |
| 316 | |
| 317 | func (p *packageTracker) Write() { |
| 318 | sort.SliceStable( |
| 319 | p.packages, func(i, j int) bool { |
| 320 | return p.packages[i].Name < p.packages[j].Name |
| 321 | }, |
| 322 | ) |
| 323 | for _, pkg := range p.packages { |
| 324 | pkg.Output = strings.TrimRight(pkg.Output, "\n") |
| 325 | pkg.Reason = strings.TrimRight(pkg.Reason, "\n") |
| 326 | sort.SliceStable( |
| 327 | pkg.TestCases, func(i, j int) bool { |
| 328 | return compareTestCaseNames(pkg.TestCases[i].Name, pkg.TestCases[j].Name) |
| 329 | }, |
| 330 | ) |
| 331 | for _, tc := range pkg.TestCases { |
| 332 | tc.Output = strings.TrimRight(tc.Output, "\n") |
| 333 | if tc.Result == "" { |
| 334 | tc.Result = ResultFail |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | for _, pkg := range p.packages { |
| 339 | p.target <- pkg |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | func compareTestCaseNames(name1 string, name2 string) bool { |
| 344 | parts1 := strings.SplitN(name1, "/", -1) |
no test coverage detected