mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-03 20:52:47 -05:00
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user