]> Cypherpunks repositories - gostls13.git/commitdiff
testing: fix time reported for failing tests.
authorRob Pike <r@golang.org>
Fri, 7 Oct 2011 21:15:16 +0000 (14:15 -0700)
committerRob Pike <r@golang.org>
Fri, 7 Oct 2011 21:15:16 +0000 (14:15 -0700)
t.ns was hanging after recent changes.

R=gri, rsc
CC=golang-dev
https://golang.org/cl/5237044

src/pkg/testing/testing.go

index 4c2ff3d48781821e3053f4b18932024b372e203c..a555cb4a1563e23c458337d014065da95be773cf 100644 (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()