Skip to content

Commit d311c16

Browse files
committed
Satisfy clippy and make proptest optional for msrv
1 parent 5085b81 commit d311c16

4 files changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name: Continuous integration
1212
env:
1313
CARGO_TERM_COLOR: always
1414
HOST: x86_64-unknown-linux-gnu
15-
FEATURES: "approx,serde,rayon"
15+
FEATURES: "approx,serde,rayon,proptest"
1616
RUSTFLAGS: "-D warnings"
1717
MSRV: 1.87.0
1818
BLAS_MSRV: 1.87.0
@@ -44,7 +44,7 @@ jobs:
4444
toolchain: ${{ matrix.rust }}
4545
components: clippy
4646
- uses: Swatinem/rust-cache@v2
47-
- run: cargo clippy --features approx,serde,rayon
47+
- run: cargo clippy "${FEATURES}"
4848

4949
format:
5050
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ matrixmultiply = { version = "0.3.2", default-features = false, features=["cgemm
5151
serde = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
5252
rawpointer = { version = "0.2" }
5353

54+
proptest = { workspace = true, optional = true }
55+
5456
[dev-dependencies]
5557
defmac = "0.2"
5658
quickcheck = { workspace = true }
5759
approx = { workspace = true, default-features = true }
5860
itertools = { workspace = true }
5961
ndarray-gen = { workspace = true }
60-
proptest = { workspace = true }
6162

6263
[features]
6364
default = ["std"]
@@ -75,6 +76,8 @@ matrixmultiply-threading = ["matrixmultiply/threading"]
7576

7677
portable-atomic-critical-section = ["portable-atomic/critical-section"]
7778

79+
proptest = ["dep:proptest"]
80+
7881

7982
[target.'cfg(not(target_has_atomic = "ptr"))'.dependencies]
8083
portable-atomic = { version = "1.6.0" }

scripts/all-tests.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ CHANNEL=$2
88

99
QC_FEAT=--features=ndarray-rand/quickcheck
1010

11+
# Proptest needs 1.85, MSRV is 1.64, so only run proptest tests if MSRV is not set or if we're on a newer channel than MSRV
12+
if [[ -z "${MSRV}" ]] && [ "$CHANNEL" != "$MSRV" ]; then
13+
FEATURES="$FEATURES,proptest"
14+
fi
15+
1116
# build check with no features
1217
cargo build -v --no-default-features
1318

src/impl_methods.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ use alloc::slice;
1010
use alloc::vec;
1111
#[cfg(not(feature = "std"))]
1212
use alloc::vec::Vec;
13-
#[cfg(test)]
13+
#[cfg(all(test, feature = "proptest"))]
1414
use proptest::prop_assert_eq;
15-
#[cfg(test)]
15+
#[cfg(all(test, feature = "proptest"))]
1616
use proptest::proptest;
17-
#[cfg(test)]
17+
#[cfg(all(test, feature = "proptest"))]
1818
use proptest::strategy::Just;
19-
#[cfg(test)]
19+
#[cfg(all(test, feature = "proptest"))]
2020
use proptest::strategy::Strategy;
2121
#[allow(unused_imports)]
2222
use rawpointer::PointerExt;
@@ -3619,7 +3619,8 @@ mod tests
36193619
}
36203620
}
36213621

3622-
#[cfg(test)]
3622+
#[cfg(all(test, feature = "proptest"))]
3623+
#[cfg_attr(miri, ignore)]
36233624
proptest! {
36243625
#[test]
36253626
fn test_permute_axes_6d(p in Just([0, 1, 2, 3, 4, 5]).prop_shuffle()) {

0 commit comments

Comments
 (0)