diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-01-05 08:39:37 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-01-05 08:39:37 +0000 |
commit | 5fbd5a2ee98badc71867d2e7fce4d1429189267a (patch) | |
tree | e16886fb2e0e443d6bb02b99375c66d8f40cd96b /src/bin/obnam-benchmark.rs | |
parent | 945b7cb605691889cef4d81e421816e55243c95b (diff) | |
parent | f368595170ccfe9689b7ce2da9e26454d9bd4edb (diff) | |
download | obnam-benchmark-5fbd5a2ee98badc71867d2e7fce4d1429189267a.tar.gz |
Merge branch 'summain-try2' into 'main'
test: be quiet unless test.py fails
See merge request obnam/obnam-benchmark!5
Diffstat (limited to 'src/bin/obnam-benchmark.rs')
-rw-r--r-- | src/bin/obnam-benchmark.rs | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/bin/obnam-benchmark.rs b/src/bin/obnam-benchmark.rs index e6a476c..f079d75 100644 --- a/src/bin/obnam-benchmark.rs +++ b/src/bin/obnam-benchmark.rs @@ -10,7 +10,6 @@ use structopt::StructOpt; fn main() { pretty_env_logger::init_custom_env("OBNAM_BENCHMARK_LOG"); - println!("START"); info!("obnam-benchmark starts"); if let Err(err) = real_main() { eprintln!("ERROR: {}", err); @@ -18,7 +17,6 @@ fn main() { exit(1); } info!("obnam-benchmark ends successfully"); - println!("END"); } fn real_main() -> anyhow::Result<()> { @@ -30,6 +28,7 @@ fn real_main() -> anyhow::Result<()> { Command::GenerateJunk(x) => x.run()?, Command::Run(x) => x.run()?, Command::Spec(x) => x.run()?, + Command::Steps(x) => x.run()?, } Ok(()) @@ -51,6 +50,9 @@ enum Command { /// Generate some junk data in a file. GenerateJunk(GenerateJunk), + + /// Show the steps for running a benchmark. + Steps(Steps), } #[derive(Debug, StructOpt)] @@ -129,3 +131,24 @@ impl GenerateJunk { Ok(()) } } + +#[derive(Debug, StructOpt)] +struct Steps { + /// Name of the specification file + #[structopt(parse(from_os_str))] + spec: PathBuf, +} + +impl Steps { + fn run(&self) -> anyhow::Result<()> { + info!( + "showing steps to run benchmarks from {}", + self.spec.display() + ); + let spec = Specification::from_file(&self.spec)?; + for step in spec.steps().iter() { + println!("{:?}", step); + } + Ok(()) + } +} |