Closed
Description
Description
cargo test --all --doc
doesn't work if workspace contains a binary crate (including root).
Examples
cargo new --bin root
cd root
cargo new --lib foo
cargo new --lib bar
echo >> Cargo.toml <<EOF
[workspace]
members = ["foo", "bar"]
EOF
cargo test --all --doc #ERROR
echo '' > src/lib.rs
cargo test --all --doc #OK
cargo new --lib root
cd root
cargo new --lib foo
cargo new --bin bar
echo >> Cargo.toml <<EOF
[workspace]
members = ["foo", "bar"]
EOF
cargo test --all --doc #ERROR
echo '' > bar/src/lib.rs
cargo test --all --doc #OK
Workaround
Supposing flat workspace:
rc=0
for lib in {.,*}/src/lib.rs; do
pushd "${lib%/src/lib.rs}"
cargo test --doc || rc=$?
popd
done
exit $rc