diff options
author | Dmitri Shuralyov <dmitshur@golang.org> | 2023-09-03 14:23:02 -0400 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-09-05 23:35:29 +0000 |
commit | 0dfb22ed70749a2cd6d95ec6eee63bb213a940d4 (patch) | |
tree | ba421b5cae00d9541f48ab2710a76e7fd722adda /src/cmd/go/alldocs.go | |
parent | cffdfe8d2cabbe874bceaeed1eba92cc567be6db (diff) | |
download | go-0dfb22ed70749a2cd6d95ec6eee63bb213a940d4.tar.gz go-0dfb22ed70749a2cd6d95ec6eee63bb213a940d4.zip |
all: use ^TestName$ regular pattern for invoking a single test
Use ^ and $ in the -run flag regular expression value when the intention
is to invoke a single named test. This removes the reliance on there not
being another similarly named test to achieve the intended result.
In particular, package syscall has tests named TestUnshareMountNameSpace
and TestUnshareMountNameSpaceChroot that both trigger themselves setting
GO_WANT_HELPER_PROCESS=1 to run alternate code in a helper process. As a
consequence of overlap in their test names, the former was inadvertently
triggering one too many helpers.
Spotted while reviewing CL 525196. Apply the same change in other places
to make it easier for code readers to see that said tests aren't running
extraneous tests. The unlikely cases of -run=TestSomething intentionally
being used to run all tests that have the TestSomething substring in the
name can be better written as -run=^.*TestSomething.*$ or with a comment
so it is clear it wasn't an oversight.
Change-Id: Iba208aba3998acdbf8c6708e5d23ab88938bfc1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/524948
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/go/alldocs.go')
-rw-r--r-- | src/cmd/go/alldocs.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 2c8f59e682..3174c6af32 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Code generated by 'go test cmd/go -v -run=TestDocsUpToDate -fixdocs'; DO NOT EDIT. +// Code generated by 'go test cmd/go -v -run=^TestDocsUpToDate$ -fixdocs'; DO NOT EDIT. // Edit the documentation in other files and then execute 'go generate cmd/go' to generate this one. // Go is a tool for managing Go source code. |