Skip to content

Doc test failures in cargo test are ignored #343

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

Closed
huonw opened this issue Aug 7, 2014 · 2 comments
Closed

Doc test failures in cargo test are ignored #343

huonw opened this issue Aug 7, 2014 · 2 comments

Comments

@huonw
Copy link
Member

huonw commented Aug 7, 2014

// lib.rs

/// ```rust
/// fail!()
/// ```
pub fn foo() {}
$ cargo test
   Compiling example v0.0.0 (file:///home/huon/projects/test-rust/tmp)
     Running ../target/test/example-8be7945be85d60d6

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests example

running 1 test
test foo_0 ... FAILED

failures:

---- foo_0 stdout ----
    task 'foo_0' failed at 'test executable failed:
    Some(task '<main>' failed at 'explicit failure', <anon>:5
    )', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustdoc/test.rs:204



failures:
    foo_0

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured

task '<unnamed>' failed at 'Some tests failed', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libtest/lib.rs:242

$ echo $?
0
@alexcrichton
Copy link
Member

This is actually a bug in rustdoc it looks like:

$ cat foo.rs
#![crate_type = "lib"]
///
/// ```
/// fail!();
/// ```
pub fn foo() {}
$ rustdoc --test foo.rs

running 1 test
test foo_0 ... FAILED

failures:

---- foo_0 stdout ----
        task 'foo_0' failed at 'test executable failed:
        Some(task '<main>' failed at 'explicit failure', <anon>:5
        )', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustdoc/test.rs:204



failures:
    foo_0

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured

task '<unnamed>' failed at 'Some tests failed', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libt
est/lib.rs:242
$ echo $?
0

@alexcrichton
Copy link
Member

Closing in favor of rust-lang/rust#16341

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

No branches or pull requests

2 participants