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

Doc tests are no longer passed dev-dependencies #1474

Closed
daboross opened this issue Apr 2, 2015 · 0 comments · Fixed by #1477
Closed

Doc tests are no longer passed dev-dependencies #1474

daboross opened this issue Apr 2, 2015 · 0 comments · Fixed by #1477

Comments

@daboross
Copy link
Contributor

daboross commented Apr 2, 2015

Previously, any doc tests run would have access to dependencies listed in the dev-dependencies section. However, cargo no longer passes any of the dev-dependencies to rustdoc.

This broke somewhere between the 2015-03-31 nightly and the 2015-04-01 nightly (72f2af1...84d6d2c).

When running on the 2015-03-31 cargo, this is the command passed to rustdoc (shown via --verbose):

rustdoc --test /home/daboross/testtest/src/lib.rs --crate-name testtest -L /home/daboross/testtest/target/debug -L /home/daboross/testtest/target/debug/deps --extern testtest=/home/daboross/testtest/target/debug/libtesttest-bdababdfeee27a0f.rlib --extern regex=/home/daboross/testtest/target/debug/deps/libregex-d1f533f77c53e903.rlib

With the newer nightly, this is passed:

rustdoc --test /home/daboross/testtest/src/lib.rs --crate-name testtest -L dependency=/home/daboross/testtest/target/debug/deps --extern testtest=/home/daboross/testtest/target/debug/libtesttest-bdababdfeee27a0f.rlib

The test was done with a simple project, with no dependencies and with the regex crate as a dev-dependency.

Cargo.toml:

[package]
name = "testtest"
version = "0.0.1"
authors = ["Dabo Ross <daboross@daboross.net>"]

[dev-dependencies]
regex = "0.1.*"

lib.rs:

//! ```rust
//! extern crate regex;
//! ```

#[test]
fn it_works() {
}
alexcrichton added a commit to alexcrichton/cargo that referenced this issue Apr 2, 2015
Previously the "add immediate deps" logic bailed out too soon and didn't pick up
all dev-dependencies.

Closes rust-lang#1474
daboross added a commit to daboross/fern that referenced this issue Apr 3, 2015
- Add a workaround in rust test in docs for rust-lang/cargo#1474
- Implement From for errors instead of FromError
- Remove now unrequired feature gate
- Implement Error for errors, instead of just having fmt::Display implemented
daboross added a commit to daboross/fern that referenced this issue Apr 4, 2015
….3.3

- Derive Clone for all types deriving Copy
- Have test depend on `time` crate instead of `chrono` crate, as chrono hasn't updated for rustc version 9854143cb
- Update docs a bit for that switch to `time` crate
- Instead of implementing a sudo-time crate as a workaround for rust-lang/cargo#1474, just disable the doc test, and copy the code to a separate file in tests/
bors added a commit that referenced this issue Apr 7, 2015
Previously the "add immediate deps" logic bailed out too soon and didn't pick up
all dev-dependencies.

Closes #1474
@bors bors closed this as completed in #1477 Apr 7, 2015
daboross added a commit to daboross/fern that referenced this issue May 12, 2015
…cate test in the tests/ directory.

This was previously not possible because of rust-lang/cargo#1474.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant