Skip to content

Commit 81cb935

Browse files
dmitshurgopherbot
authored andcommitted
unix, windows: use ^TestName$ regular pattern for invoking a single test
For reasons motivated in the commit message of CL 524948. Change-Id: I0085411f30a77634962239ee36d15e7b6ef893ef Reviewed-on: https://go-review.googlesource.com/c/sys/+/525618 Auto-Submit: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 5154691 commit 81cb935

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

unix/syscall_zos_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ func TestFlock(t *testing.T) {
757757
if err != nil {
758758
t.Fatalf("Flock: %s", err.Error())
759759
}
760-
cmd := exec.Command(os.Args[0], "-test.run=TestFlock", f.Name())
760+
cmd := exec.Command(os.Args[0], "-test.run=^TestFlock$", f.Name())
761761
cmd.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=1")
762762
out, err := cmd.CombinedOutput()
763763
if len(out) > 0 || err != nil {

windows/svc/svc_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func TestIsWindowsServiceWhenParentExits(t *testing.T) {
182182
// in parent process
183183

184184
// Start the child and exit quickly.
185-
child := exec.Command(os.Args[0], "-test.run=TestIsWindowsServiceWhenParentExits")
185+
child := exec.Command(os.Args[0], "-test.run=^TestIsWindowsServiceWhenParentExits$")
186186
child.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=child")
187187
err := child.Start()
188188
if err != nil {
@@ -221,7 +221,7 @@ func TestIsWindowsServiceWhenParentExits(t *testing.T) {
221221
for i := 0; i < 10; i++ {
222222
childDumpPath := filepath.Join(t.TempDir(), "issvc.txt")
223223

224-
parent := exec.Command(os.Args[0], "-test.run=TestIsWindowsServiceWhenParentExits")
224+
parent := exec.Command(os.Args[0], "-test.run=^TestIsWindowsServiceWhenParentExits$")
225225
parent.Env = append(os.Environ(),
226226
"GO_WANT_HELPER_PROCESS=parent",
227227
"GO_WANT_HELPER_PROCESS_FILE="+childDumpPath)

0 commit comments

Comments
 (0)