Capture more test output, e.g. race detection results

This commit is contained in:
Ingmar Stein
2017-06-22 12:43:57 +02:00
parent 15422cf504
commit 01656fa7f4
4 changed files with 126 additions and 6 deletions

View File

@ -71,7 +71,9 @@ var testCases = []TestCase{
Name: "TestTwo",
Time: 130,
Result: parser.PASS,
Output: []string{},
Output: []string{
"exit status 1",
},
},
},
},
@ -201,7 +203,9 @@ var testCases = []TestCase{
Name: "TestTwo",
Time: 130,
Result: parser.PASS,
Output: []string{},
Output: []string{
"exit status 1",
},
},
},
},
@ -642,6 +646,63 @@ var testCases = []TestCase{
},
},
},
{
name: "17-race.txt",
reportName: "17-report.xml",
report: &parser.Report{
Packages: []parser.Package{
{
Name: "race_test",
Time: 15,
Tests: []*parser.Test{
{
Name: "TestRace",
Time: 0,
Result: parser.FAIL,
Output: []string{
"test output",
"2 0xc4200153d0",
"==================",
"WARNING: DATA RACE",
"Write at 0x00c4200153d0 by goroutine 7:",
" race_test.TestRace.func1()",
" race_test.go:13 +0x3b",
"",
"Previous write at 0x00c4200153d0 by goroutine 6:",
" race_test.TestRace()",
" race_test.go:15 +0x136",
" testing.tRunner()",
" /usr/local/Cellar/go/1.8.3/libexec/src/testing/testing.go:657 +0x107",
"",
"Goroutine 7 (running) created at:",
" race_test.TestRace()",
" race_test.go:14 +0x125",
" testing.tRunner()",
" /usr/local/Cellar/go/1.8.3/libexec/src/testing/testing.go:657 +0x107",
"",
"Goroutine 6 (running) created at:",
" testing.(*T).Run()",
" /usr/local/Cellar/go/1.8.3/libexec/src/testing/testing.go:697 +0x543",
" testing.runTests.func1()",
" /usr/local/Cellar/go/1.8.3/libexec/src/testing/testing.go:882 +0xaa",
" testing.tRunner()",
" /usr/local/Cellar/go/1.8.3/libexec/src/testing/testing.go:657 +0x107",
" testing.runTests()",
" /usr/local/Cellar/go/1.8.3/libexec/src/testing/testing.go:888 +0x4e0",
" testing.(*M).Run()",
" /usr/local/Cellar/go/1.8.3/libexec/src/testing/testing.go:822 +0x1c3",
" main.main()",
" _test/_testmain.go:52 +0x20f",
"==================",
"testing.go:610: race detected during execution of test",
"exit status 1",
},
},
},
},
},
},
},
{
name: "18-coverpkg.txt",
reportName: "18-report.xml",