Skip to content

Commit 5d063c3

Browse files
committed
Conditionally compile benches
The bench tests all need `rand` and one of `alloc`/`std`. Instead of putting attributes everywhere just put one on the individual `benches` modules.
1 parent 14d54ad commit 5d063c3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ecdh.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ mod tests {
235235
}
236236
}
237237

238-
#[cfg(all(test, feature = "unstable"))]
238+
#[cfg(all(test, feature = "unstable", feature = "rand", any(features = "alloc", feature = "std")))]
239239
mod benches {
240240
use rand::thread_rng;
241241
use test::{Bencher, black_box};

src/ecdsa/recovery.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ mod tests {
371371
}
372372

373373

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

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ mod tests {
984984
}
985985
}
986986

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

0 commit comments

Comments
 (0)