MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / wrap

Method wrap

src/executor/helpers/command.rs:88–111  ·  view source on GitHub ↗
(&mut self, wrapper: S, wrapper_args: I)

Source from the content-addressed store, hash-verified

86 }
87
88 pub fn wrap<S, I, T>(&mut self, wrapper: S, wrapper_args: I) -> &mut Self
89 where
90 S: AsRef<OsStr>,
91 I: IntoIterator<Item = T>,
92 T: AsRef<OsStr>,
93 {
94 let mut new_argv = Vec::new();
95
96 // Add wrapper arguments first
97 for arg in wrapper_args {
98 new_argv.push(arg.as_ref().to_owned());
99 }
100
101 // Add the current program
102 new_argv.push(self.program.clone());
103
104 // Add the current arguments
105 new_argv.extend(self.argv.iter().cloned());
106
107 // Update program to wrapper and argv to the new argument list
108 self.program = wrapper.as_ref().to_owned();
109 self.argv = new_argv;
110 self
111 }
112
113 pub fn wrap_with(&mut self, wrapper_cmd: CommandBuilder) -> &mut Self {
114 let mut new_argv = Vec::new();

Callers 8

wrap_with_hookFunction · 0.80
test_wrap_with_argsFunction · 0.80
test_wrap_without_argsFunction · 0.80
test_multiple_wrapsFunction · 0.80
test_wrap_with_spacesFunction · 0.80
test_wrap_and_buildFunction · 0.80
wrap_with_envFunction · 0.80
wrap_with_sudoFunction · 0.80

Calls

no outgoing calls

Tested by 5

test_wrap_with_argsFunction · 0.64
test_wrap_without_argsFunction · 0.64
test_multiple_wrapsFunction · 0.64
test_wrap_with_spacesFunction · 0.64
test_wrap_and_buildFunction · 0.64