]> Cypherpunks repositories - gostls13.git/commit
os: clean up tests
authorBryan C. Mills <bcmills@google.com>
Tue, 13 Dec 2022 21:04:09 +0000 (16:04 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 19 Jan 2023 20:45:37 +0000 (20:45 +0000)
commite49cb0208b17936f370753c820cb8dfef8d2bd5e
tree1165682592889945b2f21999fbf01f9291be9f78
parentf2884bf42317011371440d90805e63248d94c45d
os: clean up tests

- Use testenv.Command instead of exec.Command to try to get more
  useful timeout behavior.

- Parallelize tests that appear not to require global state.
  (And add explanatory comments for a few that are not
  parallelizable for subtle reasons.)

- Consolidate some “Helper” tests with their parent tests.

- Use t.TempDir instead of os.MkdirTemp when appropriate.

- Factor out subtests for repeated test helpers.

For #36107.
Updates #22315.

Change-Id: Ic24b6957094dcd40908a59f48e44c8993729222b
Reviewed-on: https://go-review.googlesource.com/c/go/+/458015
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
16 files changed:
src/os/env_test.go
src/os/error_test.go
src/os/exec_unix_test.go
src/os/executable_test.go
src/os/os_test.go
src/os/os_unix_test.go
src/os/os_windows_test.go
src/os/path_test.go
src/os/path_windows_test.go
src/os/pipe_test.go
src/os/read_test.go
src/os/readfrom_linux_test.go
src/os/removeall_test.go
src/os/stat_test.go
src/os/tempfile_test.go
src/os/timeout_test.go