]> Cypherpunks repositories - gostls13.git/commit
os/exec: simplify Windows-specific tests
authorBryan C. Mills <bcmills@google.com>
Tue, 12 Sep 2023 18:50:50 +0000 (14:50 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 13 Sep 2023 18:19:21 +0000 (18:19 +0000)
commit105f9d51691d996c1698811ca3906b505639f49b
treedfaff28df7063619dbabb9f83b4ff9f860ce03db
parentdd2279ee344a59ad50a73ebce5ab80c93fbbe732
os/exec: simplify Windows-specific tests

- Use the test binary itself for printing paths instead of building a
  separate binary and running it through additional subprocesses.

- Factor out a common chdir helper.

- Use t.Setenv where appropriate.

- Reduce indirection in test helpers.

- Set NoDefaultCurrentDirectoryInExePath consistently in the
  environment.

Also add a test case demonstrating an interesting behavior for
relative paths that may interact with #62596.

Fixes #62594.
For #62596.

Change-Id: I19b9325034edf78cd0ca747594476cd7432bb451
Reviewed-on: https://go-review.googlesource.com/c/go/+/528035
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/os/exec/dot_test.go
src/os/exec/exec_test.go
src/os/exec/lp_unix_test.go
src/os/exec/lp_windows_test.go