1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:14:45 -07:00
go/src/testing
Diogo Pinela 15f2cbf437 testing: allow marking subtest and subbenchmark functions as Helpers
Since subtests and subbenchmarks run in a separate goroutine, and thus
a separate stack, this entails capturing the stack trace at the point
tb.Run is called. The work of getting the file and line information from
this stack is only done when needed, however.

Continuing the search into the parent test also requires temporarily
holding its mutex. Since Run does not hold it while waiting for the
subtest to complete, there should be no risk of a deadlock due to this.

Fixes #24128

Change-Id: If0bb169f3ac96bd48794624e619ade7edb599f83
Reviewed-on: https://go-review.googlesource.com/108658
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2018-05-14 17:59:59 +00:00
..
internal/testdeps runtime/pprof: introduce "allocs" profile 2018-04-24 16:11:41 +00:00
iotest testing/iotest: fix NewReadLogger documentation typo 2017-10-19 15:59:21 +00:00
quick
allocs_test.go
allocs.go
benchmark_test.go
benchmark.go testing: allow marking subtest and subbenchmark functions as Helpers 2018-05-14 17:59:59 +00:00
cover.go
example.go all: use strings.Builder instead of bytes.Buffer where appropriate 2018-03-26 23:05:53 +00:00
export_test.go
helper_test.go testing: allow marking subtest and subbenchmark functions as Helpers 2018-05-14 17:59:59 +00:00
helperfuncs_test.go testing: allow marking subtest and subbenchmark functions as Helpers 2018-05-14 17:59:59 +00:00
match_test.go
match.go testing: fix typo mistake 2018-04-27 13:29:12 +00:00
sub_test.go testing: gracefully handle subtest failing parent’s T 2018-03-01 10:17:22 +00:00
testing_test.go
testing.go testing: allow marking subtest and subbenchmark functions as Helpers 2018-05-14 17:59:59 +00:00