Merge pull request #45 from posener/build-error

Fail package in case of build error
This commit is contained in:
Joël Stemmer
2017-04-01 12:38:20 +01:00
committed by GitHub
5 changed files with 132 additions and 5 deletions

View File

@ -487,6 +487,64 @@ var testCases = []TestCase{
},
},
},
{
name: "13-syntax-error.txt",
reportName: "13-report.xml",
report: &parser.Report{
Packages: []parser.Package{
{
Name: "package/name/passing1",
Time: 100,
Tests: []*parser.Test{
{
Name: "TestA",
Time: 100,
Result: parser.PASS,
Output: []string{},
},
},
},
{
Name: "package/name/passing2",
Time: 100,
Tests: []*parser.Test{
{
Name: "TestB",
Time: 100,
Result: parser.PASS,
Output: []string{},
},
},
},
{
Name: "package/name/failing1",
Tests: []*parser.Test{
{
Name: "build failed",
Time: 0,
Result: parser.FAIL,
Output: []string{
"failing1/failing_test.go:15: undefined: x",
},
},
},
},
{
Name: "package/name/failing2",
Tests: []*parser.Test{
{
Name: "build failed",
Time: 0,
Result: parser.FAIL,
Output: []string{
"failing2/another_failing_test.go:20: undefined: y",
},
},
},
},
},
},
},
}
func TestParser(t *testing.T) {