Create a process which starts running in the background.
Usage: spawn command arguments
If log_command
is true
(which is the default), log the command being executed.
If log_status_on_exit
is true
(which is the default), log the exit code when the process terminates.
If log_output
is true
(which is the default), log the stdout
and stderr
output.
Parameter name
specifies the prefix (in brackets) that is added to each logged output line. Parameter color
specifies the color of those output lines.
Parameter hooks
allows to attach some hooks to the process. Warning: if you use hooks
, all the process output is stored in memory until it finishes. So this can use a lot of memory. Also, note that stdout
is sent to the hook first, then stderr
. The two outputs are not interleaved. This is to make it more predictable for regression tests.
Note that this function can only be called if Background.register
is allowed (which is the case inside functions given to Test.register
).
Parameter runner
specifies the runner on which to run the process. If unspecified, the process runs locally. Otherwise, it runs on the given runner using SSH.
Example: spawn "git" [ "log"; "-p" ]