Skip to content

Commit ffe6d47

Browse files
committed
tests: Test CPU-based RNG on all x86 targets
This allows us to verify the RDRAND implementation on Linux. Signed-off-by: Joe Richey <[email protected]>
1 parent 628228c commit ffe6d47

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,5 @@ pub fn getrandom(dest: &mut [u8]) -> Result<(), Error> {
217217

218218
#[cfg(test)]
219219
mod test_common;
220+
#[cfg(test)]
221+
mod test_cpu;

src/test_cpu.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// We only test the CPU-based RNG source on supported architectures.
2+
#![cfg(target_arch = "x86_64")]
3+
4+
#[path = "rdrand.rs"]
5+
mod rdrand;
6+
use rdrand::getrandom_inner as getrandom;
7+
#[path = "test_common.rs"]
8+
mod test_common;

0 commit comments

Comments
 (0)