go/src/os/exec/exec_test.go

var haveUnexpectedFDs

func init() {}

// TestMain allows the test binary to impersonate many other binaries,
// some of which may manipulate os.Stdin, os.Stdout, and/or os.Stderr
// (and thus cannot run as an ordinary Test function, since the testing
// package monkey-patches those variables before running tests).
func TestMain(m *testing.M) {}

// registerHelperCommand registers a command that the test process can impersonate.
// A command should be registered in the same source file in which it is used.
// If all tests are run and pass, all registered commands must be used.
// (This prevents stale commands from accreting if tests are removed or
// refactored over time.)
func registerHelperCommand(name string, f func(...string)) {}

// maySkipHelperCommand records that the test that uses the named helper command
// was invoked, but may call Skip on the test before actually calling
// helperCommand.
func maySkipHelperCommand(name string) {}

// helperCommand returns an exec.Cmd that will run the named helper command.
func helperCommand(t *testing.T, name string, args ...string) *exec.Cmd {}

// helperCommandContext is like helperCommand, but also accepts a Context under
// which to run the command.
func helperCommandContext(t *testing.T, ctx context.Context, name string, args ...string) (cmd *exec.Cmd) {}

var helperCommandUsed

var helperCommands

func cmdEcho(args ...string) {}

func cmdEchoEnv(args ...string) {}

func cmdCat(args ...string) {}

func cmdPipeTest(...string) {}

func cmdStdinClose(...string) {}

func cmdExit(args ...string) {}

func cmdDescribeFiles(args ...string) {}

func cmdStderrFail(...string) {}

func cmdYes(args ...string) {}

func TestEcho(t *testing.T) {}

func TestCommandRelativeName(t *testing.T) {}

func TestCatStdin(t *testing.T) {}

func TestEchoFileRace(t *testing.T) {}

func TestCatGoodAndBadFile(t *testing.T) {}

func TestNoExistExecutable(t *testing.T) {}

func TestExitStatus(t *testing.T) {}

func TestExitCode(t *testing.T) {}

func TestPipes(t *testing.T) {}

const stdinCloseTestString

// Issue 6270.
func TestStdinClose(t *testing.T) {}

// Issue 17647.
// It used to be the case that TestStdinClose, above, would fail when
// run under the race detector. This test is a variant of TestStdinClose
// that also used to fail when run under the race detector.
// This test is run by cmd/dist under the race detector to verify that
// the race detector no longer reports any problems.
func TestStdinCloseRace(t *testing.T) {}

// Issue 5071
func TestPipeLookPathLeak(t *testing.T) {}

func TestExtraFiles(t *testing.T) {}

func TestExtraFilesRace(t *testing.T) {}

type delayedInfiniteReader

func (delayedInfiniteReader) Read(b []byte) (int, error) {}

// Issue 9173: ignore stdin pipe writes if the program completes successfully.
func TestIgnorePipeErrorOnSuccess(t *testing.T) {}

type badWriter

func (w *badWriter) Write(data []byte) (int, error) {}

func TestClosePipeOnCopyError(t *testing.T) {}

func TestOutputStderrCapture(t *testing.T) {}

func TestContext(t *testing.T) {}

func TestContextCancel(t *testing.T) {}

// test that environment variables are de-duped.
func TestDedupEnvEcho(t *testing.T) {}

func TestEnvNULCharacter(t *testing.T) {}

func TestString(t *testing.T) {}

func TestStringPathNotResolved(t *testing.T) {}

func TestNoPath(t *testing.T) {}

// TestDoubleStartLeavesPipesOpen checks for a regression in which calling
// Start twice, which returns an error on the second call, would spuriously
// close the pipes established in the first call.
func TestDoubleStartLeavesPipesOpen(t *testing.T) {}

func cmdHang(args ...string) {}

type tickReader

func newTickReader(interval time.Duration) *tickReader {}

func (r *tickReader) Read(p []byte) (n int, err error) {}

func startHang(t *testing.T, ctx context.Context, hangTime time.Duration, interrupt os.Signal, waitDelay time.Duration, flags ...string) *exec.Cmd {}

func TestWaitInterrupt(t *testing.T) {}

func TestCancelErrors(t *testing.T) {}

// TestConcurrentExec is a regression test for https://go.dev/issue/61080.
//
// Forking multiple child processes concurrently would sometimes hang on darwin.
// (This test hung on a gomote with -count=100 after only a few iterations.)
func TestConcurrentExec(t *testing.T) {}

// TestPathRace tests that [Cmd.String] can be called concurrently
// with [Cmd.Start].
func TestPathRace(t *testing.T) {}

func TestAbsPathExec(t *testing.T) {}