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

Rustdoc --test does not fail if tests fail #16341

Closed
alexcrichton opened this issue Aug 8, 2014 · 0 comments
Closed

Rustdoc --test does not fail if tests fail #16341

alexcrichton opened this issue Aug 8, 2014 · 0 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

$ 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
bors added a commit that referenced this issue Aug 9, 2014
Now that rustdoc is spawning a child task, the program won't exit with a default
error code if the main task fails (because it never fails). This commit forces
the main task to wait for a child task in order to correctly propagate failure.

Closes #16341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant