Make #[feature(test)] depend on #[cfg(all(test, feature = "bench"))].

* FIXES Issue #38:
   https://github.com/isislovecruft/curve25519-dalek/pull/38
This commit is contained in:
Isis Lovecruft 2017-03-14 01:59:08 +00:00
parent 3882a41d27
commit f6930997d2
Failed to extract signature
6 changed files with 8 additions and 6 deletions

View file

@ -36,6 +36,7 @@ version = "0.4"
default = ["std"] default = ["std"]
std = ["rand"] std = ["rand"]
yolocrypto = [] yolocrypto = []
bench = []
# The development profile, used for `cargo build`. # The development profile, used for `cargo build`.
[profile.dev] [profile.dev]

View file

@ -1354,7 +1354,7 @@ mod test {
// Benchmarks // Benchmarks
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
#[cfg(test)] #[cfg(all(test, feature = "bench"))]
mod bench { mod bench {
use test::Bencher; use test::Bencher;
use constants; use constants;

View file

@ -358,7 +358,7 @@ mod test {
} }
} }
#[cfg(test)] #[cfg(all(test, feature = "bench"))]
mod bench { mod bench {
use rand::OsRng; use rand::OsRng;
use test::Bencher; use test::Bencher;

View file

@ -1048,7 +1048,7 @@ mod test {
} }
} }
#[cfg(test)] #[cfg(all(test, feature = "bench"))]
mod bench { mod bench {
use test::Bencher; use test::Bencher;

View file

@ -12,7 +12,7 @@
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(collections))] #![cfg_attr(not(feature = "std"), feature(collections))]
#![allow(unused_features)] #![allow(unused_features)]
#![feature(test)] #![cfg_attr(feature = "bench", feature(test))]
#![deny(missing_docs)] // refuse to compile if documentation is missing #![deny(missing_docs)] // refuse to compile if documentation is missing
//! # curve25519-dalek //! # curve25519-dalek
@ -33,8 +33,9 @@
//! hatred of the Daleks. Rusty destroys the other Daleks and departs the //! hatred of the Daleks. Rusty destroys the other Daleks and departs the
//! ship, determined to track down and bring an end to the Dalek race. //! ship, determined to track down and bring an end to the Dalek race.
#[cfg(test)] #[cfg(all(test, feature = "bench"))]
extern crate test; extern crate test;
#[cfg(test)] #[cfg(test)]
extern crate sha2; extern crate sha2;

View file

@ -707,7 +707,7 @@ mod test {
} }
} }
#[cfg(test)] #[cfg(all(test, feature = "bench"))]
mod bench { mod bench {
use rand::OsRng; use rand::OsRng;
use test::Bencher; use test::Bencher;