I have project structure:
+---workspace_a
¦ ¦ Cargo.toml
¦ ¦
¦ +---src
¦ lib.rs
¦ Cargo.lock
¦ Cargo.toml
Main manifest ./Cargo.toml:
[workspace]
members = ["workspace_a"]
[dependencies.workspace_a]
path = "./workspace_a"
[features]
only_a = [
"workspace_a/only_a"
]
Workspace manifest ./workspace_a/Cargo.toml:
[package]
name = "workspace_a"
version = "0.1.0"
authors = ["author.com"]
[features]
only_a = []
And ./workspace_a/lib.rs:
#[test]
fn test_a() {
assert_eq!(1, 1);
}
#[cfg(not(feature = "only_a"))]
#[test]
fn test_b() {
assert_eq!(1, 1);
}
When i'm in root and trying cargo test --all --features only_a virtual manifest doesn't see feature in my workspace.
It's working when i'm in ./workspace_a/ or when main manifest it's not virtual.
I have project structure:
Main manifest
./Cargo.toml:Workspace manifest
./workspace_a/Cargo.toml:And
./workspace_a/lib.rs:When i'm in root and trying
cargo test --all --features only_avirtual manifest doesn't see feature in my workspace.It's working when i'm in
./workspace_a/or when main manifest it's not virtual.