Exemplo n.º 1
0
func testExecutor(t *testing.T, buildExecutor func() Executor, compatible func(*testing.T)) {
	if compatible != nil {
		compatible(t)
	}

	command := func(name string, args ...string) Executor {
		e := buildExecutor()
		SetCommand(e, name, args)
		testtask.SetCmdEnv(e.Command())
		return e
	}

	Executor_Start_Invalid(t, command)
	Executor_Start_Wait_Failure_Code(t, command)
	Executor_Start_Wait(t, command)
	Executor_Start_Kill(t, command)
	Executor_Open(t, command, buildExecutor)
	Executor_Open_Invalid(t, command, buildExecutor)
}
Exemplo n.º 2
0
func testCommand(args ...string) *exec.Cmd {
	cmd := exec.Command(testtask.Path(), args...)
	testtask.SetCmdEnv(cmd)
	return cmd
}