1
0
mirror of https://github.com/golang/go synced 2024-09-24 21:10:12 -06:00

testing: fix time reported for failing tests.

t.ns was hanging after recent changes.

R=gri, rsc
CC=golang-dev
https://golang.org/cl/5237044
This commit is contained in:
Rob Pike 2011-10-07 14:15:16 -07:00
parent f566fca2b3
commit c09af50213

View File

@ -110,6 +110,7 @@ func (t *T) Failed() bool { return t.failed }
// FailNow marks the Test function as having failed and stops its execution.
// Execution will continue at the next Test.
func (t *T) FailNow() {
t.ns = time.Nanoseconds() - t.ns
t.Fail()
t.ch <- t
runtime.Goexit()