From 54039cafa83e58f271261d730dd9bf6bf78fffba Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 16 Apr 2019 20:36:33 +0200 Subject: [PATCH] try to really fix tests on macOS --- test-cargo-miri/tests/test.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test-cargo-miri/tests/test.rs b/test-cargo-miri/tests/test.rs index 7b6aaf934ec7..69a31c42a75c 100644 --- a/test-cargo-miri/tests/test.rs +++ b/test-cargo-miri/tests/test.rs @@ -20,15 +20,18 @@ fn fixed_rng() { } #[test] -#[cfg(not(target_os="macos"))] // FIXME entropy does not work on macOS fn entropy_rng() { - // Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite) - let mut rng = SmallRng::from_entropy(); - let _val = rng.gen::(); + #[cfg(not(target_os="macos"))] // FIXME entropy does not work on macOS + // (Not disabling the entire test as that would change the output.) + { + // Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite) + let mut rng = SmallRng::from_entropy(); + let _val = rng.gen::(); - // Also try per-thread RNG. - let mut rng = rand::thread_rng(); - let _val = rng.gen::(); + // Also try per-thread RNG. + let mut rng = rand::thread_rng(); + let _val = rng.gen::(); + } } // A test that won't work on miri