cargo_nextest/
double_spawn.rsuse crate::{output::OutputContext, ExpectedError, Result};
use camino::Utf8PathBuf;
use clap::Args;
use nextest_runner::double_spawn::double_spawn_child_init;
use std::os::unix::process::CommandExt;
#[derive(Debug, Args)]
pub(crate) struct DoubleSpawnOpts {
program: Utf8PathBuf,
args: String,
}
impl DoubleSpawnOpts {
pub(crate) fn exec(self, _output: OutputContext) -> Result<i32> {
double_spawn_child_init();
let args = shell_words::split(&self.args).map_err(|err| {
ExpectedError::DoubleSpawnParseArgsError {
args: self.args,
err,
}
})?;
let mut command = std::process::Command::new(&self.program);
let err = command.args(args).exec();
Err(ExpectedError::DoubleSpawnExecError { command, err })
}
}