This is a high-level summary of the organization of the rustdoc HTML test suite (tests/rustdoc-html). It is not intended to be prescriptive, but instead provide a quick survey of existing groupings.
For now, only immediate subdirectories under tests/rustdoc-html are described.
tests/rustdoc-html/anchorsCheck for the link anchors. Rustdoc uses anchors when we want to point an element on an item page, like the method of a type.
tests/rustdoc-html/assocContains tests checking how an associated item like a trait method is rendered in the docs.
tests/rustdoc-html/asyncContains tests checking the rendering of async items.
tests/rustdoc-html/autoContains tests related to auto traits implementations.
tests/rustdoc-html/codeblockContains tests to check the rendering of the code blocks (also called code examples).
tests/rustdoc-html/const-genericsMostly the same as tests/rustdoc-html/constant except that this folder focuses on the rendering of const generics. Same problematics overall.
tests/rustdoc-html/constantContains tests to check constant items rendering. Constant items can sometimes have code that needs to be kept as is or inferred, making this a very tricky topic in rustdoc. :)
tests/rustdoc-html/cross-crate-infoContains tests to check how information is used across crates. It only contains folders which all contain an auxiliary subfolder for their own dependencies (and avoid potential naming conflicts, in particular for simpler crate names).
tests/rustdoc-html/derefContains tests to check the display of items implementing the Deref and/or DerefMut traits.
tests/rustdoc-html/doc-cfgContains tests to check the rustdoc doc_cfg feature.
tests/rustdoc-html/enumContains tests for the rendering of enum types and in particular its variants.
tests/rustdoc-html/externContains tests to check how extern items (like extern "C" functions) are rendered.
tests/rustdoc-html/footnoteContains tests checking the markdown footnote features and how it is rendered.
tests/rustdoc-html/generic-associated-typesContains tests checking the rendering of items when they have generic associated types, like Iterator::Item where Item would instead be Item<'a> where Self: 'a. Fun times. :)
tests/rustdoc-html/hiddenContains tests checking both doc(hidden) and the --document-hidden-items CLI flag.
tests/rustdoc-html/implContains tests checking the rendering of impl blocks. More general than tests/rustdoc-html/generic-associated-types.
tests/rustdoc-html/inline_crossContains tests which check inlined foreign items and how they render based on the limitless list of corner cases we have to handle with reexports.
tests/rustdoc-html/inline_localSimilar to tests/rustdoc-html/inline_cross except this time it's reexports of local items. Still a lot of “fun” and dark magic.
tests/rustdoc-html/intra-docContains tests which check the intra doc links feature. This feature is very important in rustdoc as it allows to simply write the name or the path of an item to get its link generated. It comes with a lot of corner cases around scope and namespaces (illustrated by the very high number of tests in this folder).
tests/rustdoc-html/jump-to-defThis folder contains tests for the “jump to def(inition)” feature which is enabled with the --generate-link-to-definition CLI flag.
tests/rustdoc-html/macroContains tests checking the rendering of macro items (both derive and macro_rules!).
tests/rustdoc-html/macro-expansionContains tests checking the --generate-macro-expansion CLI flag.
tests/rustdoc-html/notable-traitContains tests checking the doc(notable_trait) attribute.
tests/rustdoc-html/primitiveEverything related to primitive types, like intra-doc links pointing to them, documenting them with the rustc_doc_primitive attribute, reexporting them, etc.
tests/rustdoc-html/privateEverything related to non-doc(hidden) items which aren‘t public. Either it’s struct/union fields, impl blocks containing only private items or the handling of the --document-private-items CLI flag.
tests/rustdoc-html/reexportAnother folder about reexports (might be worth merging the three of them?). It checks everything related to reexports like concatenated docs and attributes, inlining, transitive reexported crates, etc.
tests/rustdoc-html/sidebarContains tests checking the content of the sidebar like sections or links to items present on the page, etc.
tests/rustdoc-html/source-code-pagesContains tests checking the content of the source code pages (when you click on the source links).
tests/rustdoc-html/synthetic_autoSomewhat equivalent to the auto folder's tests. Both should likely be merged.
tests/rustdoc-html/typedefContains tests checking type aliases (type X = Y) rendering. In particular when the alias contains generics, meaning a specialized aliased type, allowing in some cases more auto traits implementations.
tests/rustdoc-html/unionSame as tests/rustdoc-html/enum but for union items.