From e9f7aa66d81b8d23f4b0c505c4316410e11303f8 Mon Sep 17 00:00:00 2001 From: FilipAndersson Date: Sat, 22 Oct 2022 17:39:05 +0200 Subject: [PATCH] Fixes #568 --- src/benchmark/executor.rs | 8 +++++++- src/options.rs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/benchmark/executor.rs b/src/benchmark/executor.rs index a8f84a9c6..096c6220f 100644 --- a/src/benchmark/executor.rs +++ b/src/benchmark/executor.rs @@ -130,7 +130,13 @@ impl<'a> Executor for ShellExecutor<'a> { ) -> Result<(TimingResult, ExitStatus)> { let mut command_builder = self.shell.command(); command_builder - .arg(if cfg!(windows) { "/C" } else { "-c" }) + .arg( + if cfg!(windows) && *self.shell == Shell::Default("cmd.exe") { + "/C" + } else { + "-c" + }, + ) .arg(command.get_command_line()); let mut result = run_command_and_measure_common( diff --git a/src/options.rs b/src/options.rs index 1ef3e01e4..efd684c09 100644 --- a/src/options.rs +++ b/src/options.rs @@ -20,7 +20,7 @@ pub const DEFAULT_SHELL: &str = "sh"; pub const DEFAULT_SHELL: &str = "cmd.exe"; /// Shell to use for executing benchmarked commands -#[derive(Debug)] +#[derive(Debug, PartialEq)] pub enum Shell { /// Default shell command Default(&'static str),