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

Add (a lot of) tests to rustdoc #42018

Open
GuillaumeGomez opened this issue May 15, 2017 · 6 comments
Open

Add (a lot of) tests to rustdoc #42018

GuillaumeGomez opened this issue May 15, 2017 · 6 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented May 15, 2017

Since we now have a more complete way to compare two HTML contents, I think we can now strongly reinforce rustdoc's tests (which are a bit weak and lacking for now).

cc @rust-lang/docs

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels May 15, 2017
@GuillaumeGomez GuillaumeGomez changed the title Add a shitload of tests to rustdoc Add (a lot of) tests to rustdoc May 15, 2017
@frewsxcv frewsxcv added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jun 23, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 27, 2017
@QuietMisdreavus
Copy link
Member

QuietMisdreavus commented Nov 4, 2017

Some ideas:

  • src/librustdoc/html/markdown.rs already has a #[cfg(test)] block, but it doesn't test the "hide lines of code with # " behavior.
  • src/librustdoc/test.rs could use some tests to verify how it adds attributes to the test, whether it wraps tests in a fn main(), things like that.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 16, 2018
…=GuillaumeGomez

add unit tests for rustdoc's processing of doctests

cc rust-lang#42018

There's a lot of things that rustdoc will do to massage doctests into something that can be compiled, and a lot of options that can be toggled to affect this. Hopefully this list of tests can show off that functionality.

The first commit is slightly unrelated but doesn't touch public functionality, because i found that if you have a manual `fn main`, it adds an extra line break at the end, whereas it would trim this extra line break if it were putting a `fn main` in automatically. That first commit makes it trim out that whitespace ahead of time.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 17, 2018
…=GuillaumeGomez

add unit tests for rustdoc's processing of doctests

cc rust-lang#42018

There's a lot of things that rustdoc will do to massage doctests into something that can be compiled, and a lot of options that can be toggled to affect this. Hopefully this list of tests can show off that functionality.

The first commit is slightly unrelated but doesn't touch public functionality, because i found that if you have a manual `fn main`, it adds an extra line break at the end, whereas it would trim this extra line break if it were putting a `fn main` in automatically. That first commit makes it trim out that whitespace ahead of time.
@QuietMisdreavus
Copy link
Member

QuietMisdreavus commented Mar 19, 2018

One thing i'd like to see (that will probably need cooperation from some rustbuild compiletest experts) is the ability to test the stdout-printing behavior of rustdoc in various situations. We don't have UI tests for rustdoc the same way the compiler does, so right now there's no place for these in the testing setup.

@camelid
Copy link
Member

camelid commented Oct 12, 2020

ping: Is this still an issue?

@GuillaumeGomez
Copy link
Member Author

Still waiting on #70533.

@jyn514 jyn514 added the A-testsuite Area: The testsuite used to check the correctness of rustc label Nov 4, 2020
@rylev
Copy link
Member

rylev commented Jun 17, 2021

Triage: #70533 was superseded by #79979 which has been merged. @GuillaumeGomez can this be closed? If not, we should probably add more detail to what kind of tests need to be added since this issue is not very actionable right now.

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Jun 17, 2021

Still far from done unfortunately. Please keep it open. As for the kind of tests, it's GUI ones. But being more precise is a bit complicated as we're still changing the front-end quickly for the moment.

@ehuss ehuss removed the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Jan 18, 2022
@fmease fmease added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. and removed C-enhancement Category: An issue proposing an enhancement or a PR with one. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants