]> Cypherpunks repositories - gostls13.git/commitdiff
testing: write profiles on failure
authorRuss Cox <rsc@golang.org>
Fri, 9 May 2014 16:18:50 +0000 (12:18 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 9 May 2014 16:18:50 +0000 (12:18 -0400)
Fixes #7901.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/90930044

doc/go1.3.html
src/pkg/testing/testing.go

index 62a5c0e1e652f3fb9b62c8f26492ab500787891d..60effb294d24efb9e75768653db376a1a941c357 100644 (file)
@@ -439,6 +439,7 @@ alongside the existing function
 <li>
 The <a href="/pkg/testing/"><code>testing</code></a> package now
 diagnoses tests that call <code>panic(nil)</code>, which are almost always erroneous.
+Also, tests now write profiles (if invoked with profiling flags) even on failure.
 </li>
 
 <li>
index 2e6d55596f487523be584d76271a3e958d343780..8078ba7cc03b2a93b08d9203e96afb1043176486 100644 (file)
@@ -437,6 +437,7 @@ func Main(matchString func(pat, str string) (bool, error), tests []InternalTest,
        stopAlarm()
        if !testOk || !exampleOk {
                fmt.Println("FAIL")
+               after()
                os.Exit(1)
        }
        fmt.Println("PASS")