From ae4abe7064b9f659e36f915eda42e9af1ad4c5d3 Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Mon, 3 Feb 2025 11:23:13 -0500 Subject: [PATCH] Add `Config::run_subprocess_cmd` The function `Config::run_subprocess` takes a program name and a list of arguments, constructs a command from them, and then runs the command. The function this commit adds is similar, but it accepts an already constructed command. Extracted from #4175 --- src/test/mock/clitools.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/mock/clitools.rs b/src/test/mock/clitools.rs index 80f2095126..2f28342f32 100644 --- a/src/test/mock/clitools.rs +++ b/src/test/mock/clitools.rs @@ -839,7 +839,10 @@ impl Config { for env in env { cmd.env(env.0, env.1); } + self.run_subprocess_cmd(cmd) + } + pub fn run_subprocess_cmd(&self, mut cmd: Command) -> Output { let mut retries = 8; let out = loop { let lock = CMD_LOCK.read().unwrap();