Exclude benchmark-related tests by default

This features can be enabled to use the cfg flag 'bench'.
This commit is contained in:
Eunchong Yu 2015-04-26 15:53:35 +09:00
parent 28f4c7acd2
commit 2ced2b1fb2
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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(|| {