Rollup merge of #124837 - GuillaumeGomez:migrate-rustdoc-map-file, r=jieyouxu

Migrate `run-make/rustdoc-map-file` to rmake

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@jieyouxu`
This commit is contained in:
Matthias Krüger 2024-05-09 06:04:39 +02:00 committed by GitHub
commit 4510ee3af3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 6 deletions

View File

@ -245,7 +245,6 @@ run-make/rlib-format-packed-bundled-libs/Makefile
run-make/rmeta-preferred/Makefile
run-make/rustc-macro-dep-files/Makefile
run-make/rustdoc-io-error/Makefile
run-make/rustdoc-map-file/Makefile
run-make/rustdoc-output-path/Makefile
run-make/rustdoc-scrape-examples-invalid-expr/Makefile
run-make/rustdoc-scrape-examples-macros/Makefile

View File

@ -1,5 +0,0 @@
include ../tools.mk
all:
$(RUSTDOC) -Z unstable-options --generate-redirect-map foo.rs -o "$(TMPDIR)/out"
"$(PYTHON)" validate_json.py "$(TMPDIR)/out"

View File

@ -0,0 +1,15 @@
use run_make_support::{rustdoc, tmp_dir};
use std::process::Command;
fn main() {
let out_dir = tmp_dir().join("out");
rustdoc()
.input("foo.rs")
.arg("-Zunstable-options")
.arg("--generate-redirect-map")
.output(&out_dir)
.run();
// FIXME (GuillaumeGomez): Port the python script to Rust as well.
let python = std::env::var("PYTHON").unwrap_or("python".into());
assert!(Command::new(python).arg("validate_json.py").arg(&out_dir).status().unwrap().success());
}