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

This commit is contained in:
Guillaume Gomez 2024-05-07 10:31:58 +02:00
parent 25e3949aa1
commit c078a44247
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());
}