|
| 1 | +From eea3bbaed34ab210868c324219a862a9d5f4681c Mon Sep 17 00:00:00 2001 |
| 2 | +From: Afonso Bordado < [email protected]> |
| 3 | +Date: Tue, 27 Sep 2022 08:13:58 +0100 |
| 4 | +Subject: [PATCH] Disable rand tests on mingw |
| 5 | + |
| 6 | +--- |
| 7 | + rand_distr/src/pareto.rs | 2 ++ |
| 8 | + rand_distr/tests/value_stability.rs | 4 ++++ |
| 9 | + 2 files changed, 6 insertions(+) |
| 10 | + |
| 11 | +diff --git a/rand_distr/src/pareto.rs b/rand_distr/src/pareto.rs |
| 12 | +index 217899ed9a..5f8e2c9bbb 100644 |
| 13 | +--- a/rand_distr/src/pareto.rs |
| 14 | ++++ b/rand_distr/src/pareto.rs |
| 15 | +@@ -107,6 +107,8 @@ mod tests { |
| 16 | + } |
| 17 | + |
| 18 | + #[test] |
| 19 | ++ // This is broken on x86_64-pc-windows-gnu presumably due to a broken powf implementation |
| 20 | ++ #[cfg(not(all(target_os = "windows", target_env = "gnu")))] |
| 21 | + fn value_stability() { |
| 22 | + fn test_samples<F: Float + core::fmt::Debug, D: Distribution<F>>( |
| 23 | + distr: D, zero: F, expected: &[F], |
| 24 | +diff --git a/rand_distr/tests/value_stability.rs b/rand_distr/tests/value_stability.rs |
| 25 | +index 192ba748b7..10c6ac24f6 100644 |
| 26 | +--- a/rand_distr/tests/value_stability.rs |
| 27 | ++++ b/rand_distr/tests/value_stability.rs |
| 28 | +@@ -72,6 +72,8 @@ fn unit_disc_stability() { |
| 29 | + } |
| 30 | + |
| 31 | + #[test] |
| 32 | ++// This is broken on x86_64-pc-windows-gnu |
| 33 | ++#[cfg(not(all(target_os = "windows", target_env = "gnu")))] |
| 34 | + fn pareto_stability() { |
| 35 | + test_samples(213, Pareto::new(1.0, 1.0).unwrap(), &[ |
| 36 | + 1.0423688f32, 2.1235929, 4.132709, 1.4679428, |
| 37 | +@@ -143,6 +145,8 @@ fn inverse_gaussian_stability() { |
| 38 | + } |
| 39 | + |
| 40 | + #[test] |
| 41 | ++// This is broken on x86_64-pc-windows-gnu |
| 42 | ++#[cfg(not(all(target_os = "windows", target_env = "gnu")))] |
| 43 | + fn gamma_stability() { |
| 44 | + // Gamma has 3 cases: shape == 1, shape < 1, shape > 1 |
| 45 | + test_samples(223, Gamma::new(1.0, 5.0).unwrap(), &[ |
| 46 | +-- |
| 47 | +2.30.1.windows.1 |
0 commit comments