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:
Ewan Chou 2013-04-01 22:36:41 +11:00 committed by Dave Cheney
parent e42bc0df87
commit 174a17e3c6

View file

@ -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)
}