Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize tests in workspace (cont.) #1408

Merged
merged 3 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ portable-atomic-util = { version = "0.2.0", features = [ "alloc" ] }
[workspace]
members = [
"ndarray-rand",
"extra-tests/serialization",
"extra-tests/blas",
"extra-tests/numeric",
"crates/*",
]
default-members = [
".",
"ndarray-rand",
"crates/numeric-tests",
"crates/serialization-tests",
# exclude blas-tests that depends on BLAS install
]

[workspace.dependencies]
Expand Down
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ How to use with cargo
::

[dependencies]
ndarray = "0.15.0"
ndarray = "0.16.0"

How to enable BLAS integration
------------------------------
Expand All @@ -127,8 +127,8 @@ An example configuration using system openblas is shown below. Note that only
end-user projects (not libraries) should select provider::

[dependencies]
ndarray = { version = "0.15.0", features = ["blas"] }
blas-src = { version = "0.8", features = ["openblas"] }
ndarray = { version = "0.16.0", features = ["blas"] }
blas-src = { version = "0.10", features = ["openblas"] }
openblas-src = { version = "0.10", features = ["cblas", "system"] }

Using system-installed dependencies can save a long time building dependencies.
Expand All @@ -149,6 +149,7 @@ there is no tight coupling to the ``blas-src`` version, so version selection is
=========== ============ ================ ==============
``ndarray`` ``blas-src`` ``openblas-src`` ``netlib-src``
=========== ============ ================ ==============
0.16 0.10 0.10 0.8
0.15 0.8 0.10 0.8
0.15 0.7 0.9 0.8
0.14 0.6.1 0.9.0
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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"]

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
5 changes: 0 additions & 5 deletions extra-tests/README.md

This file was deleted.

27 changes: 16 additions & 11 deletions scripts/all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@ 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

cargo test -p serialization-tests -v
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
# all with features and release (ignore test crates which is already optimized)
cargo test -v -p ndarray -p ndarray-rand --release --features "$FEATURES" $QC_FEAT --lib --tests

# BLAS tests
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

# Examples
cargo test --examples

# Benchmarks
([ "$CHANNEL" != "nightly" ] || cargo bench --no-run --verbose --features "$FEATURES")
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