Skip to content

Commit 7bdc2bd

Browse files
committed
Organize the workspace of test crates a bit better
Using workspace = true (Rust 1.64+)
1 parent 14c8123 commit 7bdc2bd

File tree

13 files changed

+42
-17
lines changed

13 files changed

+42
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
- beta
5252
- nightly
5353
- 1.64.0 # MSRV
54+
- 1.66.0 # MSRV
55+
- 1.68.0 # MSRV
5456

5557
name: tests/${{ matrix.rust }}
5658
steps:

Cargo.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,18 @@ opt-level = 2
8080
opt-level = 2
8181

8282
[workspace]
83-
members = ["ndarray-rand", "xtest-serialization", "xtest-blas", "xtest-numeric"]
83+
members = [
84+
"ndarray-rand",
85+
"extra-tests/serialization",
86+
"extra-tests/blas",
87+
"extra-tests/numeric",
88+
]
89+
90+
[workspace.dependencies]
91+
ndarray = { path = "." }
92+
num-traits = { version = "0.2", default-features = false }
93+
num-complex = { version = "0.4", default-features = false }
94+
ndarray-rand = { path = "./ndarray-rand" }
8495

8596
[package.metadata.release]
8697
no-dev-version = true

extra-tests/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# Extra Tests
3+
4+
These are test crates whose settings, features and dependencies should be
5+
separate from the main crate.

xtest-blas/Cargo.toml renamed to extra-tests/blas/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ test = false
1111
[dev-dependencies]
1212
approx = "0.5"
1313
defmac = "0.2"
14-
num-traits = "0.2"
15-
num-complex = { version = "0.4", default-features = false }
14+
num-traits = { workspace = true }
15+
num-complex = { workspace = true }
1616

1717
[dependencies]
18-
ndarray = { path = "..", features = ["approx", "blas"] }
18+
ndarray = { workspace = true, features = ["approx"] }
1919

2020
blas-src = { version = "0.10", optional = true }
2121

File renamed without changes.
File renamed without changes.

xtest-numeric/Cargo.toml renamed to extra-tests/numeric/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ edition = "2018"
77

88
[dependencies]
99
approx = "0.5"
10-
ndarray = { path = "..", features = ["approx"] }
11-
ndarray-rand = { path = "../ndarray-rand" }
10+
ndarray = { workspace = true, features = ["approx"] }
11+
ndarray-rand = { workspace = true }
1212
rand_distr = "0.4"
1313

1414
blas-src = { optional = true, version = "0.10", default-features = false, features = ["openblas"] }
@@ -19,8 +19,8 @@ version = "0.8.0"
1919
features = ["small_rng"]
2020

2121
[dev-dependencies]
22-
num-traits = { version = "0.2.14", default-features = false }
23-
num-complex = { version = "0.4", default-features = false }
22+
num-traits = { workspace = true }
23+
num-complex = { workspace = true }
2424

2525
[lib]
2626
test = false
File renamed without changes.

xtest-serialization/Cargo.toml renamed to extra-tests/serialization/Cargo.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2018"
99
test = false
1010

1111
[dependencies]
12-
ndarray = { path = "..", features = ["serde"] }
12+
ndarray = { workspace = true, features = ["serde"] }
1313

1414
[features]
1515
default = ["ron"]
@@ -21,9 +21,14 @@ default-features = false
2121
[dev-dependencies.serde_json]
2222
version = "1.0.40"
2323

24+
[dev-dependencies.rmp]
25+
# Old version to work with Rust 1.64+
26+
version = "=0.8.10"
27+
2428
[dev-dependencies.rmp-serde]
25-
version = "0.14.0"
29+
# Old version to work with Rust 1.64+
30+
version = "0.14"
2631

2732
[dependencies.ron]
28-
version = "0.5.1"
33+
version = "0.8.1"
2934
optional = true
File renamed without changes.

scripts/all-tests.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ cargo test --verbose --no-default-features
1212
cargo test --release --verbose --no-default-features
1313
cargo build --verbose --features "$FEATURES"
1414
cargo test --verbose --features "$FEATURES"
15-
cargo test --manifest-path=ndarray-rand/Cargo.toml --no-default-features --verbose
16-
cargo test --manifest-path=ndarray-rand/Cargo.toml --features quickcheck --verbose
17-
cargo test --manifest-path=xtest-serialization/Cargo.toml --verbose
18-
cargo test --manifest-path=xtest-blas/Cargo.toml --verbose --features openblas-system
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
19+
cargo test -p blas-tests -v --features blas-tests/openblas-system
20+
cargo test -p numeric-tests -v
21+
cargo test -p numeric-tests -v --features numeric-tests/test_blas
22+
1923
cargo test --examples
20-
cargo test --manifest-path=xtest-numeric/Cargo.toml --verbose
21-
cargo test --manifest-path=xtest-numeric/Cargo.toml --verbose --features test_blas
2224
([ "$CHANNEL" != "nightly" ] || cargo bench --no-run --verbose --features "$FEATURES")

0 commit comments

Comments
 (0)