aboutsummaryrefslogtreecommitdiff
path: root/src/testing/sub_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-08-05 14:30:20 -0400
committerRuss Cox <rsc@golang.org>2022-08-16 14:36:05 +0000
commitbd3c35e732ba3f4b6cbdf5d661120d11b59794bc (patch)
tree8e123e8311256ee3fdbf68021ad2b13759dd01db /src/testing/sub_test.go
parentb565476e2c812f65385595717fff191ac174cab7 (diff)
downloadgo-bd3c35e732ba3f4b6cbdf5d661120d11b59794bc.tar.xz
testing: do not print 'root' benchName during test of package testing
$ cd $GOROOT/src/testing $ go test root root root root PASS $ The root prints have been happening since Go 1.14. There is a test in sub_test.go that calls b.Run directly with a benchmark named "root", which triggers the print. Silence them. Change-Id: I2f0c186f04c6139bc24fab0e91975fcf0a8e80fc Reviewed-on: https://go-review.googlesource.com/c/go/+/421437 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/testing/sub_test.go')
-rw-r--r--src/testing/sub_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testing/sub_test.go b/src/testing/sub_test.go
index 6324d463cf..bb1715b23f 100644
--- a/src/testing/sub_test.go
+++ b/src/testing/sub_test.go
@@ -657,6 +657,10 @@ func TestBRun(t *T) {
}
},
}}
+ hideStdoutForTesting = true
+ defer func() {
+ hideStdoutForTesting = false
+ }()
for _, tc := range testCases {
t.Run(tc.desc, func(t *T) {
var ok bool