Auto merge of #150645 - GuillaumeGomez:rename-rustdoc-tests, r=Kobzol,Zalathar

Rename `tests/rustdoc` into `tests/rustdoc-html`

As discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/rename.20tests.2Frustdoc.20to.20rustdoc-html.3F/with/566142388), renaming this testsuite better reflects what they actually test. Later on, it could also allow us to add an alias to run all rustdoc tests at once.

r? @camelid
This commit is contained in:
rust-bors[bot] 2026-01-07 16:21:28 +00:00 committed by GitHub
commit fc546b94ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1081 changed files with 77 additions and 68 deletions

View file

@ -21,7 +21,7 @@ ignore = [
"/tests/pretty/", # These tests are very sensitive to source code layout.
"/tests/run-make/export", # These tests contain syntax errors.
"/tests/run-make/translation/test.rs", # This test contains syntax errors.
"/tests/rustdoc/", # Some have syntax errors, some are whitespace-sensitive.
"/tests/rustdoc-html/", # Some have syntax errors, some are whitespace-sensitive.
"/tests/rustdoc-gui/", # Some tests are sensitive to source code layout.
"/tests/rustdoc-ui/", # Some have syntax errors, some are whitespace-sensitive.
"/tests/ui/", # Some have syntax errors, some are whitespace-sensitive.

View file

@ -1582,10 +1582,10 @@ test!(UiFullDeps {
IS_HOST: true,
});
test!(Rustdoc {
path: "tests/rustdoc",
mode: CompiletestMode::Rustdoc,
suite: "rustdoc",
test!(RustdocHtml {
path: "tests/rustdoc-html",
mode: CompiletestMode::RustdocHtml,
suite: "rustdoc-html",
default: true,
IS_HOST: true,
});
@ -1969,7 +1969,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
if matches!(
mode,
CompiletestMode::RunMake
| CompiletestMode::Rustdoc
| CompiletestMode::RustdocHtml
| CompiletestMode::RustdocJs
| CompiletestMode::RustdocJson
) || matches!(suite, "rustdoc-ui" | "coverage-run-rustdoc")
@ -2758,7 +2758,7 @@ impl Step for ErrorIndex {
fn make_run(run: RunConfig<'_>) {
// error_index_generator depends on librustdoc. Use the compiler that
// is normally used to build rustdoc for other tests (like compiletest
// tests in tests/rustdoc) so that it shares the same artifacts.
// tests in tests/rustdoc-html) so that it shares the same artifacts.
let compilers = RustcPrivateCompilers::new(
run.builder,
run.builder.top_stage,
@ -3159,7 +3159,7 @@ impl Step for CrateRustdoc {
builder.compiler(builder.top_stage, target)
} else {
// Use the previous stage compiler to reuse the artifacts that are
// created when running compiletest for tests/rustdoc. If this used
// created when running compiletest for tests/rustdoc-html. If this used
// `compiler`, then it would cause rustdoc to be built *again*, which
// isn't really necessary.
builder.compiler_for(builder.top_stage, target, target)

View file

@ -21,7 +21,7 @@ pub(crate) enum CompiletestMode {
MirOpt,
Pretty,
RunMake,
Rustdoc,
RustdocHtml,
RustdocJs,
RustdocJson,
Ui,
@ -49,7 +49,7 @@ impl CompiletestMode {
Self::MirOpt => "mir-opt",
Self::Pretty => "pretty",
Self::RunMake => "run-make",
Self::Rustdoc => "rustdoc",
Self::RustdocHtml => "rustdoc-html",
Self::RustdocJs => "rustdoc-js",
Self::RustdocJson => "rustdoc-json",
Self::Ui => "ui",

View file

@ -31,8 +31,8 @@ pub(crate) const PATH_REMAP: &[(&str, &[&str])] = &[
"tests/pretty",
"tests/run-make",
"tests/run-make-cargo",
"tests/rustdoc",
"tests/rustdoc-gui",
"tests/rustdoc-html",
"tests/rustdoc-js",
"tests/rustdoc-js-std",
"tests/rustdoc-json",

View file

@ -1,6 +1,5 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test
---
[Test] test::Tidy
@ -38,9 +37,9 @@ expression: test
[Test] test::UiFullDeps
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/ui-fulldeps)
[Test] test::Rustdoc
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
- Suite(test::tests/rustdoc-html)
[Test] test::CoverageRunRustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/coverage-run-rustdoc)

View file

@ -5,9 +5,6 @@ expression: test librustdoc rustdoc
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc, test::src/tools/rustdoc})
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::RustdocBook
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/doc/rustdoc})

View file

@ -0,0 +1,10 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
expression: test librustdoc rustdoc-html
---
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/librustdoc})
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)

View file

@ -2,9 +2,6 @@
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
expression: test rustdoc
---
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::CrateRustdoc
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/rustdoc})

View file

@ -0,0 +1,7 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
expression: test rustdoc-html
---
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)

View file

@ -1,6 +1,5 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=coverage
---
[Test] test::Tidy
@ -37,9 +36,9 @@ expression: test --skip=coverage
[Test] test::UiFullDeps
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/ui-fulldeps)
[Test] test::Rustdoc
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
- Suite(test::tests/rustdoc-html)
[Test] test::CoverageRunRustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/coverage-run-rustdoc)

View file

@ -38,12 +38,12 @@ expression: test tests
[Test] test::RunMakeCargo
targets: [aarch64-unknown-linux-gnu]
- Suite(test::tests/run-make-cargo)
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::RustdocGUI
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-gui)
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)
[Test] test::RustdocJSNotStd
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-js)

View file

@ -35,12 +35,12 @@ expression: test tests --skip=coverage
[Test] test::RunMakeCargo
targets: [aarch64-unknown-linux-gnu]
- Suite(test::tests/run-make-cargo)
[Test] test::Rustdoc
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc)
[Test] test::RustdocGUI
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-gui)
[Test] test::RustdocHtml
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-html)
[Test] test::RustdocJSNotStd
targets: [x86_64-unknown-linux-gnu]
- Suite(test::tests/rustdoc-js)

View file

@ -169,7 +169,9 @@ declare_tests!(
(x_test_library, "test library"),
(x_test_librustdoc, "test librustdoc"),
(x_test_librustdoc_rustdoc, "test librustdoc rustdoc"),
(x_test_librustdoc_rustdoc_html, "test librustdoc rustdoc-html"),
(x_test_rustdoc, "test rustdoc"),
(x_test_rustdoc_html, "test rustdoc-html"),
(x_test_skip_coverage, "test --skip=coverage"),
// FIXME(Zalathar): This doesn't skip the coverage-map or coverage-run tests.
(x_test_skip_tests, "test --skip=tests"),

View file

@ -880,7 +880,7 @@ impl<'a> Builder<'a> {
test::Incremental,
test::Debuginfo,
test::UiFullDeps,
test::Rustdoc,
test::RustdocHtml,
test::CoverageRunRustdoc,
test::Pretty,
test::CodegenCranelift,

View file

@ -2099,7 +2099,7 @@ mod snapshot {
[test] compiletest-debuginfo 1 <host>
[test] compiletest-ui-fulldeps 1 <host>
[build] rustdoc 1 <host>
[test] compiletest-rustdoc 1 <host>
[test] compiletest-rustdoc-html 1 <host>
[test] compiletest-coverage-run-rustdoc 1 <host>
[test] compiletest-pretty 1 <host>
[build] rustc 1 <host> -> std 1 <host>
@ -2169,7 +2169,7 @@ mod snapshot {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("test")
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc", "rustdoc-gui", "incremental"])
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc-html", "rustdoc-gui", "incremental"])
.render_steps(), @r"
[build] llvm <host>
[build] rustc 0 <host> -> rustc 1 <host>
@ -2180,11 +2180,10 @@ mod snapshot {
[build] rustc 0 <host> -> RunMakeSupport 1 <host>
[build] rustdoc 1 <host>
[test] compiletest-run-make 1 <host>
[test] compiletest-rustdoc 1 <host>
[test] compiletest-rustdoc-html 1 <host>
[build] rustc 0 <host> -> RustdocGUITest 1 <host>
[test] rustdoc-gui 1 <host>
[test] compiletest-incremental 1 <host>
[build] rustc 1 <host> -> rustc 2 <host>
");
}
@ -2193,7 +2192,7 @@ mod snapshot {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx.config("test")
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc", "rustdoc-gui", "incremental"])
.args(&["ui", "ui-fulldeps", "run-make", "rustdoc-html", "rustdoc-gui", "incremental"])
.stage(2)
.render_steps(), @r"
[build] llvm <host>
@ -2208,11 +2207,10 @@ mod snapshot {
[build] rustc 0 <host> -> RunMakeSupport 1 <host>
[build] rustdoc 2 <host>
[test] compiletest-run-make 2 <host>
[test] compiletest-rustdoc 2 <host>
[test] compiletest-rustdoc-html 2 <host>
[build] rustc 0 <host> -> RustdocGUITest 1 <host>
[test] rustdoc-gui 2 <host>
[test] compiletest-incremental 2 <host>
[build] rustdoc 1 <host>
");
}
@ -2241,12 +2239,11 @@ mod snapshot {
[build] rustc 0 <host> -> RunMakeSupport 1 <host>
[build] rustdoc 2 <host>
[test] compiletest-run-make 2 <target1>
[test] compiletest-rustdoc 2 <target1>
[build] rustc 1 <host> -> rustc 2 <target1>
[build] rustdoc 1 <host>
[build] rustc 0 <host> -> RustdocGUITest 1 <host>
[test] rustdoc-gui 2 <target1>
[test] compiletest-incremental 2 <target1>
[build] rustc 1 <host> -> rustc 2 <target1>
[build] rustdoc 1 <host>
[build] rustc 2 <target1> -> std 2 <target1>
[build] rustdoc 2 <target1>
");
@ -2283,7 +2280,7 @@ mod snapshot {
[build] rustc 2 <host> -> rustc 3 <host>
[test] compiletest-ui-fulldeps 2 <host>
[build] rustdoc 2 <host>
[test] compiletest-rustdoc 2 <host>
[test] compiletest-rustdoc-html 2 <host>
[test] compiletest-coverage-run-rustdoc 2 <host>
[test] compiletest-pretty 2 <host>
[build] rustc 2 <host> -> std 2 <host>

View file

@ -27,7 +27,7 @@ runners:
<<: *base-job
envs:
env-x86_64-apple-tests: &env-x86_64-apple-tests
SCRIPT: ./x.py check compiletest && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
SCRIPT: ./x.py check compiletest && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc-html -- --exact
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
# Ensure that host tooling is tested on our minimum supported macOS version.

View file

@ -45,7 +45,7 @@ ENV SCRIPT python3 ../x.py \
--test-codegen-backend gcc \
--skip tests/coverage \
--skip tests/coverage-run-rustdoc \
--skip tests/rustdoc \
--skip tests/rustdoc-html \
--skip tests/rustdoc-gui \
--skip tests/rustdoc-js \
--skip tests/rustdoc-js-std \

View file

@ -100,7 +100,7 @@
- [Parallel compilation](./parallel-rustc.md)
- [Rustdoc internals](./rustdoc-internals.md)
- [Search](./rustdoc-internals/search.md)
- [The `rustdoc` test suite](./rustdoc-internals/rustdoc-test-suite.md)
- [The `rustdoc-html` test suite](./rustdoc-internals/rustdoc-html-test-suite.md)
- [The `rustdoc-gui` test suite](./rustdoc-internals/rustdoc-gui-test-suite.md)
- [The `rustdoc-json` test suite](./rustdoc-internals/rustdoc-json-test-suite.md)
- [GPU offload internals](./offload/internals.md)

View file

@ -1,6 +1,6 @@
# The `rustdoc` test suite
# The `rustdoc-html` test suite
This page is about the test suite named `rustdoc` used to test the HTML output of `rustdoc`.
This page is about the test suite named `rustdoc-html` used to test the HTML output of `rustdoc`.
For other rustdoc-specific test suites, see [Rustdoc test suites].
Each test file in this test suite is simply a Rust source file `file.rs` sprinkled with

View file

@ -24,7 +24,7 @@ Also, talk about how it works
## jsondocck
[jsondocck] processes directives given in comments, to assert that the values in the output are expected.
It's a lot like [htmldocck](./rustdoc-test-suite.md) in that way.
It's a lot like [htmldocck](./rustdoc-html-test-suite.md) in that way.
It uses [JSONPath] as a query language, which takes a path, and returns a *list* of values that that path is said to match to.

View file

@ -82,7 +82,7 @@ The following test suites are available, with links for more information:
| Test suite | Purpose |
|--------------------------------------|--------------------------------------------------------------------------|
| [`rustdoc`][rustdoc-html-tests] | Check HTML output of `rustdoc` |
| [`rustdoc-html`][rustdoc-html-tests] | Check HTML output of `rustdoc` |
| [`rustdoc-gui`][rustdoc-gui-tests] | Check `rustdoc`'s GUI using a web browser |
| [`rustdoc-js`][rustdoc-js-tests] | Check `rustdoc`'s search engine and index |
| [`rustdoc-js-std`][rustdoc-js-tests] | Check `rustdoc`'s search engine and index on the std library docs |
@ -94,7 +94,7 @@ These tests ensure that certain lints that are emitted as part of executing rust
are also run when executing rustc.
Run-make tests pertaining to rustdoc are typically named `run-make/rustdoc-*/`.
[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-test-suite.md
[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-html-test-suite.md
[rustdoc-gui-tests]: ../rustdoc-internals/rustdoc-gui-test-suite.md
[rustdoc-js-tests]: ../rustdoc-internals/search.md#testing-the-search-engine
[rustdoc-json-tests]: ../rustdoc-internals/rustdoc-json-test-suite.md

View file

@ -308,12 +308,12 @@ Asked in
#### Test-suite-specific directives
The test suites [`rustdoc`][rustdoc-html-tests], [`rustdoc-js`/`rustdoc-js-std`][rustdoc-js-tests]
The test suites [`rustdoc-html`][rustdoc-html-tests], [`rustdoc-js`/`rustdoc-js-std`][rustdoc-js-tests]
and [`rustdoc-json`][rustdoc-json-tests] each feature an additional set of directives whose basic
syntax resembles the one of compiletest directives but which are ultimately read and checked by
separate tools. For more information, please read their respective chapters as linked above.
[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-test-suite.md
[rustdoc-html-tests]: ../rustdoc-internals/rustdoc-html-test-suite.md
[rustdoc-js-tests]: ../rustdoc-internals/search.html#testing-the-search-engine
[rustdoc-json-tests]: ../rustdoc-internals/rustdoc-json-test-suite.md

View file

@ -882,7 +882,8 @@ impl<'item> DocVisitor<'item> for TypeImplCollector<'_, '_, 'item> {
//
// FIXME(lazy_type_alias): Once the feature is complete or stable, rewrite this
// to use type unification.
// Be aware of `tests/rustdoc/type-alias/deeply-nested-112515.rs` which might regress.
// Be aware of `tests/rustdoc-html/type-alias/deeply-nested-112515.rs` which might
// regress.
let Some(impl_did) = impl_item_id.as_def_id() else { continue };
let for_ty = self.cx.tcx().type_of(impl_did).skip_binder();
let reject_cx = DeepRejectCtxt::relate_infer_infer(self.cx.tcx());

View file

@ -18,7 +18,7 @@ string_enum! {
Pretty => "pretty",
DebugInfo => "debuginfo",
Codegen => "codegen",
Rustdoc => "rustdoc",
RustdocHtml => "rustdoc-html",
RustdocJson => "rustdoc-json",
CodegenUnits => "codegen-units",
Incremental => "incremental",
@ -69,7 +69,7 @@ string_enum! {
Pretty => "pretty",
RunMake => "run-make",
RunMakeCargo => "run-make-cargo",
Rustdoc => "rustdoc",
RustdocHtml => "rustdoc-html",
RustdocGui => "rustdoc-gui",
RustdocJs => "rustdoc-js",
RustdocJsStd=> "rustdoc-js-std",

View file

@ -552,7 +552,7 @@ fn check_directive<'a>(
let is_known_directive = KNOWN_DIRECTIVE_NAMES_SET.contains(&directive_name)
|| match mode {
TestMode::Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
TestMode::RustdocHtml => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
TestMode::RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
_ => false,
};

View file

@ -630,7 +630,7 @@ fn test_forbidden_revisions_allowed_in_non_filecheck_dir() {
let modes = [
"pretty",
"debuginfo",
"rustdoc",
"rustdoc-html",
"rustdoc-json",
"codegen-units",
"incremental",

View file

@ -85,7 +85,7 @@ fn parse_config(args: Vec<String>) -> Config {
"",
"mode",
"which sort of compile tests to run",
"pretty | debug-info | codegen | rustdoc \
"pretty | debug-info | codegen | rustdoc-html \
| rustdoc-json | codegen-units | incremental | run-make | ui \
| rustdoc-js | mir-opt | assembly | crashes",
)
@ -1094,8 +1094,8 @@ fn make_test_name_and_filterable_path(
/// of some other tests's name.
///
/// For example, suppose the test suite contains these two test files:
/// - `tests/rustdoc/primitive.rs`
/// - `tests/rustdoc/primitive/no_std.rs`
/// - `tests/rustdoc-html/primitive.rs`
/// - `tests/rustdoc-html/primitive/no_std.rs`
///
/// The test runner might put the output from those tests in these directories:
/// - `$build/test/rustdoc/primitive/`

View file

@ -269,7 +269,7 @@ impl<'test> TestCx<'test> {
TestMode::Pretty => self.run_pretty_test(),
TestMode::DebugInfo => self.run_debuginfo_test(),
TestMode::Codegen => self.run_codegen_test(),
TestMode::Rustdoc => self.run_rustdoc_test(),
TestMode::RustdocHtml => self.run_rustdoc_html_test(),
TestMode::RustdocJson => self.run_rustdoc_json_test(),
TestMode::CodegenUnits => self.run_codegen_units_test(),
TestMode::Incremental => self.run_incremental_test(),
@ -1758,7 +1758,7 @@ impl<'test> TestCx<'test> {
}
TestMode::Pretty
| TestMode::DebugInfo
| TestMode::Rustdoc
| TestMode::RustdocHtml
| TestMode::RustdocJson
| TestMode::RunMake
| TestMode::RustdocJs => {

View file

@ -3,7 +3,7 @@ use std::process::Command;
use super::{DocKind, TestCx, remove_and_create_dir_all};
impl TestCx<'_> {
pub(super) fn run_rustdoc_test(&self) {
pub(super) fn run_rustdoc_html_test(&self) {
assert!(self.revision.is_none(), "revisions not supported in this test suite");
let out_dir = self.output_base_dir();

View file

@ -50,7 +50,7 @@ fn incomplete_config_for_rustdoc_gui_test() -> Config {
//
// For instance, `//@ ignore-stage1` will not work at all.
Config {
mode: TestMode::Rustdoc,
mode: TestMode::RustdocHtml,
// E.g. this has no sensible default tbh.
suite: TestSuite::Ui,

View file

@ -123,7 +123,7 @@ llvm-config = "{llvm_config}"
"tests/run-make/rust-lld-x86_64-unknown-linux-gnu-dist",
"tests/ui",
"tests/crashes",
"tests/rustdoc",
"tests/rustdoc-html",
];
for test_path in env.skipped_tests() {
args.extend(["--skip", test_path]);

View file

@ -107,7 +107,7 @@ pub fn check(
&tests_path.join("ui"),
&tests_path.join("ui-fulldeps"),
&tests_path.join("rustdoc-ui"),
&tests_path.join("rustdoc"),
&tests_path.join("rustdoc-html"),
],
|path, _is_dir| {
filter_dirs(path)

Some files were not shown because too many files have changed in this diff Show more