New Scheduler struct

This commit is contained in:
David Peter authored and David Peter committed 2022-02-19 16:53:02 +01:00
1 parent 39984a3896
commit 72d27729fa
6 files changed
+118 -84

No files matched your search

+16
View File
@@ -1,12 +1,16 @@
use std::process::Command;
use std::{cmp, fmt};
use anyhow::ensure;
use atty::Stream;
use clap::ArgMatches;
use crate::command::Commands;
use crate::error::OptionsError;
use crate::util::units::{Second, Unit};
use anyhow::Result;
#[cfg(not(windows))]
pub const DEFAULT_SHELL: &str = "sh";
@@ -256,6 +260,18 @@ impl Options {
Ok(options)
}
pub fn validate_against_command_list(&self, commands: &Commands) -> Result<()> {
if let Some(preparation_command) = &self.preparation_command {
ensure!(
preparation_command.len() <= 1 || commands.len() == preparation_command.len(),
"The '--prepare' option has to be provided just once or N times, where N is the \
number of benchmark commands."
);
}
Ok(())
}
}
#[test]