Skip to content

Commit

Permalink
tests: Test CPU-based RNG on all x86 targets
Browse files Browse the repository at this point in the history
This allows us to verify the RDRAND implementation on Linux.

Signed-off-by: Joe Richey <joerichey@google.com>
  • Loading branch information
josephlr committed Feb 19, 2020
1 parent ed0e047 commit 83896d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,5 @@ pub fn getrandom(dest: &mut [u8]) -> Result<(), Error> {

#[cfg(test)]
mod test_common;
#[cfg(test)]
mod test_cpu;
8 changes: 8 additions & 0 deletions src/test_cpu.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// We only test the CPU-based RNG source on supported architectures.
#![cfg(target_arch = "x86_64")]

#[path = "rdrand.rs"]
mod rdrand;
use rdrand::getrandom_inner as getrandom;
#[path = "test_common.rs"]
mod test_common;

0 comments on commit 83896d1

Please sign in to comment.