(t *testing.T, ctx context.Context, s ...string)
| 37 | ) |
| 38 | |
| 39 | func helperCommandContext(t *testing.T, ctx context.Context, s ...string) (cmd *exec.Cmd) { |
| 40 | testenv.MustHaveExec(t) |
| 41 | |
| 42 | cs := []string{"-test.run=TestHelperProcess", "--"} |
| 43 | cs = append(cs, s...) |
| 44 | if ctx != nil { |
| 45 | cmd = exec.CommandContext(ctx, os.Args[0], cs...) |
| 46 | } else { |
| 47 | cmd = exec.Command(os.Args[0], cs...) |
| 48 | } |
| 49 | cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"} |
| 50 | return cmd |
| 51 | } |
| 52 | |
| 53 | func helperCommand(t *testing.T, s ...string) *exec.Cmd { |
| 54 | return helperCommandContext(t, nil, s...) |