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-json] Output is currently under-tested #81359

Open
6 tasks
CraftSpider opened this issue Jan 24, 2021 · 4 comments
Open
6 tasks

[rustdoc-json] Output is currently under-tested #81359

CraftSpider opened this issue Jan 24, 2021 · 4 comments
Labels
A-rustdoc-json Area: Rustdoc JSON backend 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

@CraftSpider
Copy link
Contributor

Currently, the output of rustdoc's JSON backend has very few tests, which only assure some of the most simple functionality. It would be nice to at least have tests for basic forms of each item, as well as any known issues. A quick list of things not really tested (non-exhaustive):

  • Impls
  • Associated Items
  • Consts/Statics
  • Extern items (all forms)
  • Macros
  • Types

It also would be nice to know the desired layout of the tests. Currently, the directory holds the form

root
| structs
- | plain
  | tuple
  | generic
| traits
- | has_body
| unions
- | plain
| ...

This is slightly different from how normal rustdoc ui tests are structured, but on the other hand HTML output is very different and serves a somewhat different goal. If we want to establish guidelines on the test directory layout, now is a good time to discuss it, before the directories fill up.

@CraftSpider CraftSpider added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Jan 24, 2021
@jyn514 jyn514 added A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 24, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 11, 2021
…ftSpider

Rustdoc Json: Add tests for Reexports, and improve jsondocck

The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests.

Notably does not have the case from rust-lang#80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything.

Improves rust-lang#81359

cc `@CraftSpider`

r? `@jyn514`

`@rustbot` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 11, 2021
…ftSpider

Rustdoc Json: Add tests for Reexports, and improve jsondocck

The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests.

Notably does not have the case from rust-lang#80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything.

Improves rust-lang#81359

cc ``@CraftSpider``

r? ``@jyn514``

``@rustbot`` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 11, 2021
…ftSpider

Rustdoc Json: Add tests for Reexports, and improve jsondocck

The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests.

Notably does not have the case from rust-lang#80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything.

Improves rust-lang#81359

cc ```@CraftSpider```

r? ```@jyn514```

```@rustbot``` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 11, 2022
…=CraftSpider

rustdoc-json: Add some tests for typealias item

r? `@CraftSpider`

Improves rust-lang#81359

The test's arn't pretty, and I think eventually we need a better way of doing repeated tests on a deeply nested path,
without repeating the way to get to that path

`@rustbot` modify labels: +A-rustdoc-json +T-rustdoc +A-rustdoc +A-testsuite
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 11, 2022
…=CraftSpider

rustdoc-json: Add some tests for typealias item

r? ``@CraftSpider``

Improves rust-lang#81359

The test's arn't pretty, and I think eventually we need a better way of doing repeated tests on a deeply nested path,
without repeating the way to get to that path

``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc +A-rustdoc +A-testsuite
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 11, 2022
…=CraftSpider

rustdoc-json: Add some tests for typealias item

r? ```@CraftSpider```

Improves rust-lang#81359

The test's arn't pretty, and I think eventually we need a better way of doing repeated tests on a deeply nested path,
without repeating the way to get to that path

```@rustbot``` modify labels: +A-rustdoc-json +T-rustdoc +A-rustdoc +A-testsuite
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 15, 2022
…aftSpider

rustdoc-json: More tests, and better jsondocck errors

Helps with rust-lang#81359

r? `@CraftSpider`

`@rustbot` modify labels: +A-rustdoc-json +T-rustdoc +A-testsuite
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 16, 2022
…tSpider

rustdoc-json: More tests, and better jsondocck errors

Helps with rust-lang#81359

r? `@CraftSpider`

`@rustbot` modify labels: +A-rustdoc-json +T-rustdoc +A-testsuite
@aDotInTheVoid
Copy link
Member

Another thing we don't have tests for: ItemEnum::TraitAlias

@aDotInTheVoid
Copy link
Member

  • Tests with --document-private-items and --document-hidden-items

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 20, 2023
…=notriddle

Add test for `c_variadic` in rustdoc-json

Helps with rust-lang#81359
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 14, 2023
… r=GuillaumeGomez

rustdoc-json: Add test for private supertrait.

Helps with rust-lang#81359

r? `@GuillaumeGomez`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 14, 2023
… r=GuillaumeGomez

rustdoc-json: Add test for private supertrait.

Helps with rust-lang#81359

r? ``@GuillaumeGomez``
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Jul 16, 2023
…umeGomez

rustdoc-json: Add test for private supertrait.

Helps with rust-lang/rust#81359

r? ``@GuillaumeGomez``
@aDotInTheVoid
Copy link
Member

jieyouxu added a commit to jieyouxu/rust that referenced this issue Jul 8, 2024
…as_tests, r=aDotInTheVoid

rustdoc-json: add type/trait alias tests

Not sure if this tests everything there is to test in them though.

Updates rust-lang#81359
jieyouxu added a commit to jieyouxu/rust that referenced this issue Jul 8, 2024
…as_tests, r=aDotInTheVoid

rustdoc-json: add type/trait alias tests

Not sure if this tests everything there is to test in them though.

Updates rust-lang#81359
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 8, 2024
Rollup merge of rust-lang#127459 - its-the-shrimp:rustdocjson_add_alias_tests, r=aDotInTheVoid

rustdoc-json: add type/trait alias tests

Not sure if this tests everything there is to test in them though.

Updates rust-lang#81359
@aDotInTheVoid
Copy link
Member

workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 29, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? `@fmease`
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 29, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? ``@fmease``
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 30, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? ```@fmease```
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 30, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? ````@fmease````
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 31, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? `````@fmease`````
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 31, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? ``````@fmease``````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 31, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? ```````@fmease```````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 31, 2024
…=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? ````````@fmease````````
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 31, 2024
Rollup merge of rust-lang#129123 - aDotInTheVoid:rustdoc-json-self, r=fmease

rustdoc-json: Add test for `Self` type

Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.

I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)

Updates rust-lang#81359

r? ````````@fmease````````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend 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

4 participants