tests: adds a bench for rustups subcommand parsing

This commit is contained in:
Kevin K 2017-02-27 23:39:34 -05:00
parent 8da0303bc0
commit a822ad8c27
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A

View file

@ -17,6 +17,11 @@ fn build_app(b: &mut Bencher) { b.iter(|| build_cli()); }
#[bench]
fn parse_clean(b: &mut Bencher) { b.iter(|| build_cli().get_matches_from(vec![""])); }
#[bench]
fn parse_subcommands(b: &mut Bencher) {
b.iter(|| build_cli().get_matches_from(vec!["rustup override add stable"]));
}
pub fn build_cli() -> App<'static, 'static> {
App::new("rustup")
.version("0.9.0") // Simulating