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

Implement doc tests #302

Merged
merged 2 commits into from
Aug 7, 2014
Merged

Implement doc tests #302

merged 2 commits into from
Aug 7, 2014

Conversation

alexcrichton
Copy link
Member

Whenever cargo test is run and a testable library target is available, the doc
tests will be run. This can be opted out of with test = false as usual.

This is currently not super useful due to rust-lang/rust#16157, but I expect
that to be merged soon. In the meantime examples will need to extern crate foo
explicitly.

Closes #334

@steveklabnik
Copy link
Member

Sweeeet.

@sfackler
Copy link
Member

sfackler commented Aug 2, 2014

Is this good to go now that the rustdoc bug is fixed?

@alexcrichton
Copy link
Member Author

Yes, this should be good to go.

The logic for doc tests will get a little complex, so this is moved to aseparate
module instead of inside the executable.
Whenever `cargo test` is run and a testable library target is available, the doc
tests will be run. This can be opted out of with `test = false` as usual.

This is currently not super useful due to rust-lang/rust#16157, but I expect
that to be merged soon. In the meantime examples will need to `extern crate foo`
explicitly.
@alexcrichton
Copy link
Member Author

Blocked on rust-lang/rust#16275

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 6, 2014
There's a good long comment explaining why. The tl;dr; is that I have no idea
why this is necessary, but it gets --test to work on windows which is something,
right?

cc rust-lang#13259
cc rust-lang#16275
cc rust-lang/cargo#302
bors added a commit that referenced this pull request Aug 6, 2014
Whenever `cargo test` is run and a testable library target is available, the doc
tests will be run. This can be opted out of with `test = false` as usual.

This is currently not super useful due to rust-lang/rust#16157, but I expect
that to be merged soon. In the meantime examples will need to `extern crate foo`
explicitly.

Closes #334
@bors bors merged commit 35ac31e into rust-lang:master Aug 7, 2014
@alexcrichton alexcrichton deleted the doc-test branch August 7, 2014 00:33
bors added a commit to alexcrichton/cargo that referenced this pull request Sep 2, 2014
Whenever `cargo test` is run and a testable library target is available, the doc
tests will be run. This can be opted out of with `test = false` as usual.

This is currently not super useful due to rust-lang/rust#16157, but I expect
that to be merged soon. In the meantime examples will need to `extern crate foo`
explicitly.

Closes rust-lang#334
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 this pull request may close these issues.

Have 'cargo test' (or something) run 'rustdoc --test'
4 participants