Skip to content

Commit

Permalink
TEST: Remove ndarray build.rs and test-blas-openblas-sys feature flag
Browse files Browse the repository at this point in the history
This flag was not properly used anymore. Replace it with a proper blas
test setup in xtest-numeric.
  • Loading branch information
bluss committed Mar 25, 2021
1 parent f98e5c0 commit a6b82fd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
5 changes: 1 addition & 4 deletions Cargo.toml
Expand Up @@ -18,8 +18,6 @@ description = "An n-dimensional array for general elements and for numerics. Lig
keywords = ["array", "data-structure", "multidimensional", "matrix", "blas"]
categories = ["data-structures", "science"]

build = "build.rs"

exclude = ["docgen/images/*"]

[lib]
Expand Down Expand Up @@ -63,8 +61,7 @@ blas = ["cblas-sys", "libc"]
serde-1 = ["serde"]

# These features are used for testing
test-blas-openblas-sys = ["blas"]
test = ["test-blas-openblas-sys"]
test = []

# This feature is used for docs
docs = ["approx", "serde", "rayon"]
Expand Down
1 change: 1 addition & 0 deletions scripts/all-tests.sh
Expand Up @@ -18,4 +18,5 @@ cargo test --manifest-path=xtest-serialization/Cargo.toml --verbose
cargo test --manifest-path=xtest-blas/Cargo.toml --verbose
cargo test --examples
CARGO_TARGET_DIR=target/ cargo test --manifest-path=xtest-numeric/Cargo.toml --verbose
CARGO_TARGET_DIR=target/ cargo test --manifest-path=xtest-numeric/Cargo.toml --verbose --features test_blas
([ "$CHANNEL" != "nightly" ] || cargo bench --no-run --verbose --features "$FEATURES")
5 changes: 4 additions & 1 deletion xtest-numeric/Cargo.toml
Expand Up @@ -10,6 +10,9 @@ ndarray = { path = "..", features = ["approx"] }
ndarray-rand = { path = "../ndarray-rand/" }
rand_distr = "0.4"

blas-src = { optional = true, version = "0.7.0", default-features = false, features = ["openblas"] }
openblas-src = { optional = true, version = "0.9", default-features = false, features = ["cblas", "system"] }

[dependencies.rand]
version = "0.8.0"
features = ["small_rng"]
Expand All @@ -18,7 +21,7 @@ features = ["small_rng"]
test = false

[features]
test_blas = ["ndarray/blas", "ndarray/test-blas-openblas-sys"]
test_blas = ["ndarray/blas", "blas-src", "openblas-src"]

[profile.dev]
opt-level = 2
Expand Down
2 changes: 1 addition & 1 deletion build.rs → xtest-numeric/build.rs
Expand Up @@ -4,7 +4,7 @@

fn main() {
println!("cargo:rerun-if-changed=build.rs");
if cfg!(feature = "test-blas-openblas-sys") {
if cfg!(feature = "test_blas") {
println!("cargo:rustc-link-lib=dylib=openblas");
}
}
3 changes: 3 additions & 0 deletions xtest-numeric/src/lib.rs
@@ -0,0 +1,3 @@
#[cfg(feature = "test_blas")]
extern crate blas_src;

2 changes: 2 additions & 0 deletions xtest-numeric/tests/accuracy.rs
Expand Up @@ -4,6 +4,8 @@ extern crate ndarray;
extern crate ndarray_rand;
extern crate rand;

extern crate numeric_tests;

use ndarray_rand::{RandomExt, F32};
use rand::{Rng, SeedableRng};
use rand::rngs::SmallRng;
Expand Down

0 comments on commit a6b82fd

Please sign in to comment.