Skip to content

Commit

Permalink
Simplify all-tests.sh
Browse files Browse the repository at this point in the history
Use workspace features better in all-tests.sh
  • Loading branch information
bluss committed Aug 2, 2024
1 parent 874f6b4 commit 0787e86
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
6 changes: 1 addition & 5 deletions crates/serialization-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ test = false
ndarray = { workspace = true, features = ["serde"] }

serde = { version = "1.0.100", default-features = false }
ron = { version = "0.8.1", optional = true }
ron = { version = "0.8.1" }

[dev-dependencies]
serde_json = { version = "1.0.40" }
# Old version to work with Rust 1.64+
rmp = { version = "=0.8.10" }
# Old version to work with Rust 1.64+
rmp-serde = { version = "0.14" }

[features]
default = ["ron"]

2 changes: 0 additions & 2 deletions crates/serialization-tests/tests/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ extern crate serde_json;

extern crate rmp_serde;

#[cfg(feature = "ron")]
extern crate ron;

use ndarray::{arr0, arr1, arr2, s, ArcArray, ArcArray2, ArrayD, IxDyn};
Expand Down Expand Up @@ -179,7 +178,6 @@ fn serial_many_dim_serde_msgpack()
}

#[test]
#[cfg(feature = "ron")]
fn serial_many_dim_ron()
{
use ron::de::from_str as ron_deserialize;
Expand Down
21 changes: 11 additions & 10 deletions scripts/all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ set -e
FEATURES=$1
CHANNEL=$2

cargo build --verbose --no-default-features
# Testing both dev and release profiles helps find bugs, especially in low level code
cargo test --verbose --no-default-features
cargo test --release --verbose --no-default-features
cargo build --verbose --features "$FEATURES"
cargo test --verbose --features "$FEATURES"
cargo test -p ndarray-rand --no-default-features --verbose
cargo test -p ndarray-rand --features ndarray-rand/quickcheck --verbose
QC_FEAT=--features=ndarray-rand/quickcheck

# build check with no features
cargo build -v --no-default-features

# ndarray with no features
cargo test -p ndarray -v --no-default-features
# all with features
cargo test -v --features "$FEATURES" $QC_FEAT
# with features and release (ignore numeric-tests which is already optimized)
cargo test -v --release --features "$FEATURES" $QC_FEAT --exclude numeric-tests --lib --tests

cargo test -p serialization-tests -v
cargo test -p blas-tests -v --features blas-tests/openblas-system
cargo test -p numeric-tests -v
cargo test -p numeric-tests -v --features numeric-tests/test_blas

cargo test --examples
Expand Down
9 changes: 4 additions & 5 deletions scripts/cross-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ FEATURES=$1
CHANNEL=$2
TARGET=$3

cross build -v --features="$FEATURES" --target=$TARGET
cross test -v --no-fail-fast --features="$FEATURES" --target=$TARGET
cross test -v --no-fail-fast --target=$TARGET -p ndarray-rand --features ndarray-rand/quickcheck
cross test -v --no-fail-fast --target=$TARGET -p serialization-tests --verbose
cross test -v --no-fail-fast --target=$TARGET -p numeric-tests --release
QC_FEAT=--features=ndarray-rand/quickcheck

cross build -v --features="$FEATURES" $QC_FEAT --target=$TARGET
cross test -v --no-fail-fast --features="$FEATURES" $QC_FEAT --target=$TARGET

0 comments on commit 0787e86

Please sign in to comment.