Skip to content

Fix #12939: reporting of ignored tests in rustdoc - #13272

Merged
bors merged 1 commit into
rust-lang:masterfrom
ipetkov:rustdoc-ignored-tests
Apr 4, 2014
Merged

bors merged 1 commit into
rust-lang:masterfrom
ipetkov:rustdoc-ignored-tests

Conversation

@ipetkov

@ipetkov ipetkov commented Apr 3, 2014

Copy link
Copy Markdown
Contributor

librustdoc: instead of skipping ignored tests, pass them to libtest
so it can report them as such. If a test is marked as notrust,
however, it will not show up in the final report.

Fix #12939

Comment thread src/librustdoc/html/markdown.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition should change slightly I think. It should consider ignore as "print this during the test run, but don't run it" and notrust as "ignore this entirely for testing".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a really good point, hadn't thought about that!

@alexcrichton

Copy link
Copy Markdown
Member

I'm a little confused about the changes to libtest, could you provide a before/after of what you changed? For example, this is what I get today:

#[test] fn a() {}
#[ignore] #[test] fn b() {}
$ ./foo                     

running 2 tests
test b ... ignored
test a ... ok

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

librustdoc: instead of skipping ignored tests, pass them to libtest
so it can report them as such.  If a test is marked as `notrust`,
however, it will not show up in the final report.
@ipetkov

ipetkov commented Apr 4, 2014

Copy link
Copy Markdown
Contributor Author

Sorry I should have made this clearer: this change affects running documentation tests under rustdoc, e.g.

// foo.rs
#![crate_id="foo"]

//! This is a small crate

/**
```rust
assert!(true);
```

```ignore
assert!(!false);
```
*/
/// foo always returns 5
pub fn foo() -> int {
    5
}
$ rustdoc --test foo.rs 

running 1 test
test foo_0 ... ok

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

This is the result I get after building from master, when it should really output test result: 1 passed; 0 failed; 1 ignored; 0 measured for the last line.

I'm a little confused about the changes to libtest, could you provide a before/after of what you changed?

Looking over the diff again I just realized my misunderstanding of some code in libtest. I (wrongly) believed that libtest was also dropping tests marked as ignored, and tried to "improve" the code. The main problem for this issue is just rustdoc ignoring the tests. I'll remove my changes to libtest and update the PR branch.

@ipetkov

ipetkov commented Apr 4, 2014

Copy link
Copy Markdown
Contributor Author

Updated the PR branch, and re-rebased on master

bors added a commit that referenced this pull request Apr 4, 2014
…hton

librustdoc: instead of skipping ignored tests, pass them to libtest
so it can report them as such.  If a test is marked as `notrust`,
however, it will not show up in the final report.

Fix #12939
@bors bors closed this Apr 4, 2014
@bors
bors merged commit a0a7693 into rust-lang:master Apr 4, 2014
@ipetkov
ipetkov deleted the rustdoc-ignored-tests branch April 5, 2014 02:39
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Oct 11, 2022
docs(guide): fix Analysis and AnalysisHost doc links
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 24, 2024
flip1995: 2 week vacation

r? `@ghost`
changelog: none
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.

rustdoc treats ignored doc tests incorrectly

3 participants