go/src/testing
Matt T. Proud 0941dbca6a testing: clarify in docs that TestMain is advanced
Beginner and intermediate Go users periodically use TestMain when
requirements do not necessitate TestMain (exceeding least-mechanism
design). This commit expands package testing's documentation to convey
that the TestMain feature itself is somewhat low-level and potentially
unsuitable for casual testing where ordinary test functions would
suffice.

Fixes #42161
Updates #44200

Change-Id: I91ba0b048c3d6f79110fe8f0fbb58d896edca366
Reviewed-on: https://go-review.googlesource.com/c/go/+/334649
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2021-07-15 20:39:22 +00:00
..
fstest io/fs: document that caller can modify slice returned by ReadFile 2021-04-21 16:46:52 +00:00
internal/testdeps cmd/go, testing, os: fail test that calls os.Exit(0) 2020-08-27 23:19:15 +00:00
iotest all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
quick all: shorten some tests 2019-05-22 12:54:00 +00:00
allocs.go
allocs_test.go
benchmark.go testing: remove data races so that parallel benchmarks can safely call .Fatal* and .Skip* 2021-04-19 22:06:05 +00:00
benchmark_test.go testing: remove data races so that parallel benchmarks can safely call .Fatal* and .Skip* 2021-04-19 22:06:05 +00:00
cover.go
example.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
export_test.go
helper_test.go testing: update helperNames just before checking it 2021-03-19 01:04:37 +00:00
helperfuncs_test.go testing: fix reported caller name for funcs passed to Cleanup 2020-05-05 22:44:36 +00:00
match.go
match_test.go
panic_test.go testing: don't run Cleanup functions until parallel subtests complete 2020-01-16 21:32:12 +00:00
run_example.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
run_example_js.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
sub_test.go testing: print late arriving log line in panic 2021-02-24 16:38:56 +00:00
testing.go testing: clarify in docs that TestMain is advanced 2021-07-15 20:39:22 +00:00
testing_test.go testing: drop unusual characters from TempDir directory name 2021-06-17 04:32:50 +00:00