From 191868573d5e2d5101b4dff85ddc786fec43eb77 Mon Sep 17 00:00:00 2001 From: Yong Wen Chua Date: Mon, 17 Jul 2017 18:06:06 +0800 Subject: [PATCH] Add bench --- tests/fairing.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/fairing.rs b/tests/fairing.rs index e223bef..8bde6ce 100644 --- a/tests/fairing.rs +++ b/tests/fairing.rs @@ -1,10 +1,11 @@ //! This crate tests using rocket_cors using Fairings -#![feature(plugin, custom_derive)] +#![feature(plugin, custom_derive, test)] #![plugin(rocket_codegen)] extern crate hyper; extern crate rocket; extern crate rocket_cors; +extern crate test; use std::str::FromStr; @@ -85,6 +86,13 @@ fn smoke_test() { } +use test::Bencher; + +#[bench] +fn bench_smoke_test(b: &mut Bencher) { + b.iter(|| smoke_test()); +} + #[test] fn cors_options_check() { let client = Client::new(rocket()).unwrap();