(commands: Vec<BenchmarkCommand>)
| 13 | mod preload_lib_file; |
| 14 | |
| 15 | pub fn perform(commands: Vec<BenchmarkCommand>) -> Result<()> { |
| 16 | let hooks = InstrumentHooks::instance(INTEGRATION_NAME, INTEGRATION_VERSION); |
| 17 | |
| 18 | for benchmark_cmd in commands { |
| 19 | let name_and_uri = uri::generate_name_and_uri(&benchmark_cmd.name, &benchmark_cmd.command); |
| 20 | name_and_uri.print_executing(); |
| 21 | |
| 22 | let mut cmd = Command::new(&benchmark_cmd.command[0]); |
| 23 | cmd.args(&benchmark_cmd.command[1..]); |
| 24 | hooks.start_benchmark().unwrap(); |
| 25 | let status = cmd.status(); |
| 26 | hooks.stop_benchmark().unwrap(); |
| 27 | let status = status.context("Failed to execute command")?; |
| 28 | |
| 29 | if !status.success() { |
| 30 | bail!("Command exited with non-zero status: {status}"); |
| 31 | } |
| 32 | |
| 33 | hooks.set_executed_benchmark(&name_and_uri.uri).unwrap(); |
| 34 | } |
| 35 | |
| 36 | Ok(()) |
| 37 | } |
| 38 | |
| 39 | /// Executes the given benchmark commands using a preload based trick to handle valgrind control. |
| 40 | /// |
nothing calls this directly
no test coverage detected