func TestCmdReporterHelperProcess(*testing.T) {
	if os.Getenv("GO_WANT_HELPER_PROCESS") != "1" {
		return
	}

	args := os.Args
	for len(args) > 0 {
		if args[0] == "--" {
			args = args[1:]
			break
		}
		args = args[1:]
	}
	if len(args) == 0 {
		fmt.Fprintf(os.Stderr, "No command\n")
		os.Exit(2)
	}
	userCommand := args

	// test should set these in its environment to control the output of the test commands
	stdout := os.Getenv("GO_HELPER_PROCESS_STDOUT")
	stderr := os.Getenv("GO_HELPER_PROCESS_STDERR")
	retcode := os.Getenv("GO_HELPER_PROCESS_RETCODE")

	if os.Getenv("GO_HELPER_PROCESS_PRINT_COMMAND") == "1" {
		stdout = strings.Join(userCommand, " ")
		stderr = ""
		retcode = ""
	}

	if stdout != "" {
		fmt.Fprint(os.Stdout, stdout)
	}
	if stderr != "" {
		fmt.Fprint(os.Stderr, stderr)
	}
	if retcode != "" {
		rc, err := strconv.Atoi(retcode)
		if err != nil {
			panic(err)
		}
		os.Exit(rc)
	}
	os.Exit(0)
}
// TestHelperProcess isn't a real test. It's used as a helper process
// for TestParameterRun.
// Inspired by: https://github.com/golang/go/blob/master/src/os/exec/exec_test.go
TestHelperProcess isn't a real test. It's used as a helper process
for TestParameterRun.
// TestHelperProcess isn ' t a real test . It ' s used as a helper process // for TestParameterRun . // Inspired by : https : // github . com / golang / go / blob / master / src / os / exec / exec_test . go
func TestCmdReporterHelperProcess(*testing.T) {
	if os.Getenv("GO_WANT_HELPER_PROCESS") != "1" {
		return
	}
	args := os.Args
	for len(args) > 0 {
		if args[0] == "--" {
			args = args[1:]
			break
		}
		args = args[1:]
	}
	if len(args) == 0 {
		fmt.Fprintf(os.Stderr, "No command\n")
		os.Exit(2)
	}
	userCommand := args
	stdout := os.Getenv("GO_HELPER_PROCESS_STDOUT")
	stderr := os.Getenv("GO_HELPER_PROCESS_STDERR")
	retcode := os.Getenv("GO_HELPER_PROCESS_RETCODE")
	if os.Getenv("GO_HELPER_PROCESS_PRINT_COMMAND") == "1" {
		stdout = strings.Join(userCommand, " ")
		stderr = ""
		retcode = ""
	}
	if stdout != "" {
		fmt.Fprint(os.Stdout, stdout)
	}
	if stderr != "" {
		fmt.Fprint(os.Stderr, stderr)
	}
	if retcode != "" {
		rc, err := strconv.Atoi(retcode)
		if err != nil {
			panic(err)
		}
		os.Exit(rc)
	}
	os.Exit(0)
}
func TestCmdReporterHelperProcess ( * testing . T ) { if os . Getenv ( " " ) != " " { return } args := os . Args for len ( args ) > 0 { if args [ 0 ] == " " { args = args [ 1 : ] break } args = args [ 1 : ] } if len ( args ) == 0 { fmt . Fprintf ( os . Stderr , " \n " ) os . Exit ( 2 ) } userCommand := args stdout := os . Getenv ( " " ) stderr := os . Getenv ( " " ) retcode := os . Getenv ( " " ) if os . Getenv ( " " ) == " " { stdout = strings . Join ( userCommand , " " ) stderr = " " retcode = " " } if stdout != " " { fmt . Fprint ( os . Stdout , stdout ) } if stderr != " " { fmt . Fprint ( os . Stderr , stderr ) } if retcode != " " { rc , err := strconv . Atoi ( retcode ) if err != nil { panic ( err ) } os . Exit ( rc ) } os . Exit ( 0 ) }
TestHelperProcess isn't a real test.
TestHelperProcess isn ' t a real test .
// test should set these in its environment to control the output of the test commands