aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
authorJulien Tant <julien@craftyx.fr>2021-04-27 21:32:18 +0000
committerIan Lance Taylor <iant@golang.org>2021-04-27 21:44:16 +0000
commit645cb62ee3926ce88b8c2cf556fed6dea3d525ce (patch)
treee350273936bba921f955ceb504b0957cff090918 /src/testing/testing.go
parent30002e665658b4b2c147caaee6bf7734042952e8 (diff)
downloadgo-645cb62ee3926ce88b8c2cf556fed6dea3d525ce.tar.gz
go-645cb62ee3926ce88b8c2cf556fed6dea3d525ce.zip
testing: document that TestMain can be used with benchmarks
Fixes #45764 Change-Id: Ie6c18bb5c20721c2ffa8b4a9cf9f97cdc665a450 GitHub-Last-Rev: 8bcea7e0ff60227c05437b372c0a3546e151af31 GitHub-Pull-Request: golang/go#45808 Reviewed-on: https://go-review.googlesource.com/c/go/+/314349 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/testing/testing.go')
-rw-r--r--src/testing/testing.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 2146195956..1562eadef0 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -208,14 +208,14 @@
//
// Main
//
-// It is sometimes necessary for a test program to do extra setup or teardown
-// before or after testing. It is also sometimes necessary for a test to control
+// It is sometimes necessary for a test or benchmark program to do extra setup or teardown
+// before or after it executes. It is also sometimes necessary to control
// which code runs on the main thread. To support these and other cases,
// if a test file contains a function:
//
// func TestMain(m *testing.M)
//
-// then the generated test will call TestMain(m) instead of running the tests
+// then the generated test will call TestMain(m) instead of running the tests or benchmarks
// directly. TestMain runs in the main goroutine and can do whatever setup
// and teardown is necessary around a call to m.Run. m.Run will return an exit
// code that may be passed to os.Exit. If TestMain returns, the test wrapper