Include failing packages without tests in report

If a package compiles correctly, but panics before it has a chance to
run any tests it would previously be ignored. Any failing packages
without tests but with some output will now be included in the report
with a dummy test.

Fixes #52
This commit is contained in:
Joël Stemmer
2017-04-27 23:19:32 +01:00
parent dd4990585e
commit 2a5fd0eeb0
6 changed files with 101 additions and 0 deletions

View File

@ -561,6 +561,55 @@ var testCases = []TestCase{
},
},
},
{
name: "14-panic.txt",
reportName: "14-report.xml",
report: &parser.Report{
Packages: []parser.Package{
{
Name: "package/panic",
Time: 3,
Tests: []*parser.Test{
{
Name: "Failure",
Result: parser.FAIL,
Output: []string{
"panic: init",
"stacktrace",
},
},
},
},
{
Name: "package/panic2",
Time: 3,
Tests: []*parser.Test{
{
Name: "Failure",
Result: parser.FAIL,
Output: []string{
"panic: init",
"stacktrace",
},
},
},
},
},
},
},
{
name: "15-empty.txt",
reportName: "15-report.xml",
report: &parser.Report{
Packages: []parser.Package{
{
Name: "package/empty",
Time: 1,
Tests: []*parser.Test{},
},
},
},
},
}
func TestParser(t *testing.T) {