Skip to content

Commit

Permalink
Conditionally compile benches
Browse files Browse the repository at this point in the history
The bench tests all need `rand` and one of `alloc`/`std`. Instead of
putting attributes everywhere just put one on the individual `benches`
modules.
  • Loading branch information
tcharding committed Jan 26, 2022
1 parent 14d54ad commit 6ebea93
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ecdh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ mod tests {
}
}

#[cfg(all(test, feature = "unstable"))]
#[cfg(all(test, feature = "unstable", feature = "rand-std", any(features = "alloc", feature = "std")))]
mod benches {
use rand::thread_rng;
use test::{Bencher, black_box};
Expand Down
2 changes: 1 addition & 1 deletion src/ecdsa/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ mod tests {
}


#[cfg(all(test, feature = "unstable"))]
#[cfg(all(test, feature = "unstable", feature = "rand-std", any(features = "alloc", feature = "std")))]
mod benches {
use rand::{thread_rng, RngCore};
use test::{Bencher, black_box};
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ mod tests {
}
}

#[cfg(all(test, feature = "unstable"))]
#[cfg(all(test, feature = "unstable", feature = "rand-std", any(features = "alloc", feature = "std")))]
mod benches {
use rand::{thread_rng, RngCore};
use test::{Bencher, black_box};
Expand Down

0 comments on commit 6ebea93

Please sign in to comment.