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

Error when running Cargo test documentation overall workspace with bin crate #5144

Closed
loganmzz opened this issue Mar 7, 2018 · 2 comments
Closed

Comments

@loganmzz
Copy link

loganmzz commented Mar 7, 2018

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
@stale
Copy link

stale bot commented Sep 15, 2018

As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it.

I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect?

The team would be especially grateful if such a comment included details such as:

  • Is this still relevant?
  • If so, what is blocking it?
  • Is it known what could be done to help move this forward?

Thank you for contributing!

If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable!

@stale stale bot added the stale label Sep 15, 2018
@ehuss
Copy link
Contributor

ehuss commented Sep 15, 2018

This has been fixed by #5873.

@ehuss ehuss closed this as completed Sep 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants