mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 23:02:31 +00:00
34368419c2
This is mostly about avoiding criterion's build times when just developing clap itself. I'm assuming the derive test changed because criterion's clap v2 isn't in the dependency tree anymore.
15 lines
447 B
Rust
15 lines
447 B
Rust
use clap::Command;
|
|
use criterion::{criterion_group, criterion_main, Criterion};
|
|
|
|
pub fn build_empty(c: &mut Criterion) {
|
|
c.bench_function("build_empty", |b| b.iter(|| Command::new("claptests")));
|
|
}
|
|
|
|
pub fn parse_empty(c: &mut Criterion) {
|
|
c.bench_function("parse_empty", |b| {
|
|
b.iter(|| Command::new("claptests").get_matches_from(vec![""]))
|
|
});
|
|
}
|
|
|
|
criterion_group!(benches, build_empty, parse_empty);
|
|
criterion_main!(benches);
|