|
0 |
From e7cdb537fdeafe471f9ee47834f7a34145c9fb8f Mon Sep 17 00:00:00 2001
|
|
1 |
From: Josh Stone <cuviper@gmail.com>
|
|
2 |
Date: Mon, 13 Jan 2020 23:55:17 -0800
|
|
3 |
Subject: [PATCH] Fix benchmarks for the rand upgrade
|
|
4 |
|
|
5 |
---
|
|
6 |
benches/bigint.rs | 3 ++-
|
|
7 |
benches/gcd.rs | 3 ++-
|
|
8 |
benches/roots.rs | 3 ++-
|
|
9 |
ci/test_full.sh | 4 ++--
|
|
10 |
4 files changed, 8 insertions(+), 5 deletions(-)
|
|
11 |
|
|
12 |
diff --git a/benches/bigint.rs b/benches/bigint.rs
|
|
13 |
index 90a7e85..5474185 100644
|
|
14 |
--- a/benches/bigint.rs
|
|
15 |
+++ b/benches/bigint.rs
|
|
16 |
@@ -9,7 +9,8 @@ extern crate test;
|
|
17 |
|
|
18 |
use num_bigint::{BigInt, BigUint, RandBigInt};
|
|
19 |
use num_traits::{FromPrimitive, Num, One, Pow, Zero};
|
|
20 |
-use rand::{SeedableRng, StdRng};
|
|
21 |
+use rand::rngs::StdRng;
|
|
22 |
+use rand::SeedableRng;
|
|
23 |
use std::mem::replace;
|
|
24 |
use test::Bencher;
|
|
25 |
|
|
26 |
diff --git a/benches/gcd.rs b/benches/gcd.rs
|
|
27 |
index 5fe5260..a2b177a 100644
|
|
28 |
--- a/benches/gcd.rs
|
|
29 |
+++ b/benches/gcd.rs
|
|
30 |
@@ -10,7 +10,8 @@ extern crate test;
|
|
31 |
use num_bigint::{BigUint, RandBigInt};
|
|
32 |
use num_integer::Integer;
|
|
33 |
use num_traits::Zero;
|
|
34 |
-use rand::{SeedableRng, StdRng};
|
|
35 |
+use rand::rngs::StdRng;
|
|
36 |
+use rand::SeedableRng;
|
|
37 |
use test::Bencher;
|
|
38 |
|
|
39 |
fn get_rng() -> StdRng {
|
|
40 |
diff --git a/benches/roots.rs b/benches/roots.rs
|
|
41 |
index 51e67d9..b5c0aad 100644
|
|
42 |
--- a/benches/roots.rs
|
|
43 |
+++ b/benches/roots.rs
|
|
44 |
@@ -8,7 +8,8 @@ extern crate test;
|
|
45 |
|
|
46 |
use num_bigint::{BigUint, RandBigInt};
|
|
47 |
use num_traits::Pow;
|
|
48 |
-use rand::{SeedableRng, StdRng};
|
|
49 |
+use rand::rngs::StdRng;
|
|
50 |
+use rand::SeedableRng;
|
|
51 |
use test::Bencher;
|
|
52 |
|
|
53 |
// The `big64` cases demonstrate the speed of cases where the value
|
|
54 |
diff --git a/ci/test_full.sh b/ci/test_full.sh
|
|
55 |
index 37505bd..43e989b 100755
|
|
56 |
--- a/ci/test_full.sh
|
|
57 |
+++ b/ci/test_full.sh
|
|
58 |
@@ -49,9 +49,9 @@ if test -n "${NO_STD_FEATURES:+true}"; then
|
|
59 |
cargo test --no-default-features --features="$NO_STD_FEATURES"
|
|
60 |
fi
|
|
61 |
|
|
62 |
-# make sure benchmarks can be built
|
|
63 |
+# make sure benchmarks can be built and sanity-tested
|
|
64 |
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
|
|
65 |
- cargo bench --all-features --no-run
|
|
66 |
+ cargo test --benches --all-features
|
|
67 |
fi
|
|
68 |
|
|
69 |
case "$STD_FEATURES" in
|