Returns string(stdout), string(stderr), error It is a particularly bad idea to run this on something that outputs loads and loads of std output over time as we'll consume heaps of memory, but we aren't doing that in our integration tests. NOTE: the standard out
(executable string, args []string, workingDirectory string, environment []string)
| 62 | // our integration tests. |
| 63 | // NOTE: the standard out |
| 64 | func runExecutable(executable string, args []string, workingDirectory string, environment []string) (stdout string, stderr string, err error) { |
| 65 | stdoutBytes, stderrBytes, err := runExecutableRawOutput(executable, args, workingDirectory, environment) |
| 66 | if stdoutBytes != nil { |
| 67 | stdout = string(stdoutBytes) |
| 68 | } else { |
| 69 | stdout = "" |
| 70 | } |
| 71 | if stderrBytes != nil { |
| 72 | stderr = string(stderrBytes) |
| 73 | } else { |
| 74 | stderr = "" |
| 75 | } |
| 76 | return |
| 77 | } |
| 78 | |
| 79 | // Runs the CLI but returns raw byte output for stdout and stderr. Typically you want to call runExecutable which returns strings instead |
| 80 | func runExecutableRawOutput(executable string, args []string, workingDirectory string, environment []string) (stdout []byte, stderr []byte, err error) { |
no test coverage detected