You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem cargo 1.50.0-nightly changes the current working directory for doctests when executed from a workspace. Instead of the crate's root, the workspace's root is assumed. The regression originates in #8954. I think, the cwd should still point to the crate root in all cases.
Steps
Crate a workspace with a member crate in a subdirectory.
Write a doctest that reads a file relative to the crate root, e.g. src/lib.rs.
Test with cargo +stable test --workspace and observe the test pass.
Test with cargo +nightly test --workspace and observe the test fail.
To avoid regressions to the test runtime directory, this asserts that
all test types (unit, integration, doctest) are executed in the crate
(manifest) directory, no matter where that crate is in relation to the
workspace root.
See rust-lang#8992 / rust-lang#8993
Assert that tests are run in the crate directory
To avoid regressions to the test runtime directory, this asserts that
all test types (unit, integration, doctest) are executed in the crate
(manifest) directory, no matter where that crate is in relation to the
workspace root.
See #8992 / #8993
Problem
cargo 1.50.0-nightly
changes the current working directory for doctests when executed from a workspace. Instead of the crate's root, the workspace's root is assumed. The regression originates in #8954. I think, the cwd should still point to the crate root in all cases.Steps
src/lib.rs
.cargo +stable test --workspace
and observe the test pass.cargo +nightly test --workspace
and observe the test fail.Possible Solution(s)
-Zinstrument-coverage
rust#79417.Notes
Output of
cargo version
:cargo 1.50.0-nightly (d274fcf86 2020-12-07)
Example
src/lib.rs
for a workspace member that will pass on stable but fail on nightly:The text was updated successfully, but these errors were encountered: