package testenv
import "golang.org/x/crypto/internal/testenv"
Index ¶
- Variables
- func Command(t testing.TB, name string, args ...string) *exec.Cmd
- func CommandContext(t testing.TB, ctx context.Context, name string, args ...string) *exec.Cmd
Variables ¶
Sigquit is the signal to send to kill a hanging subprocess. Send SIGQUIT to get a stack trace.
Functions ¶
func Command ¶
Command is like exec.Command, but applies the same changes as testenv.CommandContext (with a default Context).
func CommandContext ¶
CommandContext is like exec.CommandContext, but:
- skips t if the platform does not support os/exec,
- sends SIGQUIT (if supported by the platform) instead of SIGKILL in its Cancel function
- if the test has a deadline, adds a Context timeout and WaitDelay for an arbitrary grace period before the test's deadline expires,
- fails the test if the command does not complete before the test's deadline, and
- sets a Cleanup function that verifies that the test did not leak a subprocess.
Source Files ¶
exec.go testenv_unix.go
- Version
- v0.34.0 (latest)
- Published
- Feb 22, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 1 hour ago –
Tools for package owners.