mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: report test as failed if the test panics.
Fixes #5149. R=golang-dev, dave, minux.ma CC=golang-dev https://golang.org/cl/8136043
This commit is contained in:
parent
e42bc0df87
commit
174a17e3c6
1 changed files with 1 additions and 0 deletions
|
|
@ -337,6 +337,7 @@ func tRunner(t *T, test *InternalTest) {
|
|||
t.duration = time.Now().Sub(t.start)
|
||||
// If the test panicked, print any test output before dying.
|
||||
if err := recover(); err != nil {
|
||||
t.Fail()
|
||||
t.report()
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue