Skip to content

Commit 7f93048

Browse files
committed
Simplify all-tests.sh
Use workspace features better in all-tests.sh
1 parent 874f6b4 commit 7f93048

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

crates/serialization-tests/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@ test = false
1212
ndarray = { workspace = true, features = ["serde"] }
1313

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

1717
[dev-dependencies]
1818
serde_json = { version = "1.0.40" }
1919
# Old version to work with Rust 1.64+
2020
rmp = { version = "=0.8.10" }
2121
# Old version to work with Rust 1.64+
2222
rmp-serde = { version = "0.14" }
23-
24-
[features]
25-
default = ["ron"]
26-

crates/serialization-tests/tests/serialize.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ extern crate serde_json;
66

77
extern crate rmp_serde;
88

9-
#[cfg(feature = "ron")]
109
extern crate ron;
1110

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

181180
#[test]
182-
#[cfg(feature = "ron")]
183181
fn serial_many_dim_ron()
184182
{
185183
use ron::de::from_str as ron_deserialize;

scripts/all-tests.sh

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ set -e
66
FEATURES=$1
77
CHANNEL=$2
88

9-
cargo build --verbose --no-default-features
10-
# Testing both dev and release profiles helps find bugs, especially in low level code
11-
cargo test --verbose --no-default-features
12-
cargo test --release --verbose --no-default-features
13-
cargo build --verbose --features "$FEATURES"
14-
cargo test --verbose --features "$FEATURES"
15-
cargo test -p ndarray-rand --no-default-features --verbose
16-
cargo test -p ndarray-rand --features ndarray-rand/quickcheck --verbose
17-
18-
cargo test -p serialization-tests -v
9+
QC_FEAT=--features=ndarray-rand/quickcheck
10+
11+
# build check with no features
12+
cargo build -v --no-default-features
13+
14+
# ndarray with no features
15+
cargo test -p ndarray -v --no-default-features
16+
# all with features
17+
cargo test -v --features "$FEATURES" $QC_FEAT
18+
# all with features and release (ignore test crates which is already optimized)
19+
cargo test -v -p ndarray -p ndarray-rand --release --features "$FEATURES" $QC_FEAT --lib --tests
20+
21+
# BLAS tests
1922
cargo test -p blas-tests -v --features blas-tests/openblas-system
20-
cargo test -p numeric-tests -v
2123
cargo test -p numeric-tests -v --features numeric-tests/test_blas
2224

25+
# Examples
2326
cargo test --examples
27+
28+
# Benchmarks
2429
([ "$CHANNEL" != "nightly" ] || cargo bench --no-run --verbose --features "$FEATURES")

scripts/cross-tests.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ FEATURES=$1
77
CHANNEL=$2
88
TARGET=$3
99

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

0 commit comments

Comments
 (0)