From 21e75b3251a0e6dde7a05d77ac390fa342a1e2f8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 9 May 2014 12:18:50 -0400 Subject: [PATCH] testing: write profiles on failure Fixes #7901. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/90930044 --- doc/go1.3.html | 1 + src/pkg/testing/testing.go | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/go1.3.html b/doc/go1.3.html index 62a5c0e1e6..60effb294d 100644 --- a/doc/go1.3.html +++ b/doc/go1.3.html @@ -439,6 +439,7 @@ alongside the existing function
  • The testing package now diagnoses tests that call panic(nil), which are almost always erroneous. +Also, tests now write profiles (if invoked with profiling flags) even on failure.
  • diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go index 2e6d55596f..8078ba7cc0 100644 --- a/src/pkg/testing/testing.go +++ b/src/pkg/testing/testing.go @@ -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") -- 2.48.1