From 2ced2b1fb2a94532233414af11f3208442b39a4c Mon Sep 17 00:00:00 2001 From: Eunchong Yu Date: Sun, 26 Apr 2015 15:53:35 +0900 Subject: [PATCH] Exclude benchmark-related tests by default This features can be enabled to use the cfg flag 'bench'. --- src/lib.rs | 2 +- src/naive/date.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4cd932f..09b2dbe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -266,7 +266,7 @@ Advanced time zone handling is not yet supported (but is planned in 0.3). #![doc(html_root_url = "https://lifthrasiir.github.io/rust-chrono/")] -#![cfg_attr(test, feature(test))] // lib stability features as per RFC #507 +#![cfg_attr(bench, feature(test))] // lib stability features as per RFC #507 #![deny(missing_docs)] extern crate time as stdtime; diff --git a/src/naive/date.rs b/src/naive/date.rs index 6374d85..46e1cf1 100644 --- a/src/naive/date.rs +++ b/src/naive/date.rs @@ -1490,7 +1490,7 @@ mod internals { #[cfg(test)] mod tests { - extern crate test; + #[cfg(bench)] extern crate test; use Weekday; use super::{Of, Mdf}; @@ -1537,6 +1537,7 @@ mod internals { assert_eq!(GF.nisoweeks(), 52); } + #[cfg(bench)] #[bench] fn bench_year_flags_from_year(bh: &mut test::Bencher) { bh.iter(|| {