]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: briefly document test caching in go test -h output
authorJean de Klerk <deklerk@google.com>
Wed, 21 Feb 2018 01:26:57 +0000 (17:26 -0800)
committerRob Pike <r@golang.org>
Fri, 9 Mar 2018 11:39:11 +0000 (11:39 +0000)
Fixes #23971

Change-Id: I073f278cc058aa15a23c0ea06292c02d50a3df21
Reviewed-on: https://go-review.googlesource.com/95582
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/go/alldocs.go
src/cmd/go/internal/test/test.go

index 2788a9eef62c4c482aca32e649031c4eef3a5b10..d78a08821e4ba7872e3f6a6aa826a3191b969beb 100644 (file)
 // the package list would have to appear before -myflag, but could appear
 // on either side of -v.
 //
+// When 'go test' runs in package list mode, 'go test' caches successful
+// package test results to avoid unnecessary repeated running of tests. To
+// disable test caching, use any test flag or argument other than the
+// cacheable flags. The idiomatic way to disable test caching explicitly
+// is to use -count=1.
+//
 // To keep an argument for a test binary from being interpreted as a
 // known flag or a package name, use -args (see 'go help test') which
 // passes the remainder of the command line through to the test binary
index 0a440585cb3df7d4427eeda954f4328db94d3d54..9a53a197313a2a1c8f7926dbcb652f0b13766d7c 100644 (file)
@@ -385,6 +385,12 @@ flag not known to the go test command. Continuing the example above,
 the package list would have to appear before -myflag, but could appear
 on either side of -v.
 
+When 'go test' runs in package list mode, 'go test' caches successful
+package test results to avoid unnecessary repeated running of tests. To
+disable test caching, use any test flag or argument other than the
+cacheable flags. The idiomatic way to disable test caching explicitly
+is to use -count=1.
+
 To keep an argument for a test binary from being interpreted as a
 known flag or a package name, use -args (see 'go help test') which
 passes the remainder of the command line through to the test binary