about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-05-09 06:04:39 +0200
committerGitHub <noreply@github.com>2024-05-09 06:04:39 +0200
commit4510ee3af35d4f5496b9a44f1168570b18d5c545 (patch)
tree766fbc491e416560e1af419a02c6865d7f1d4b8d
parent9b834d01e5face5a0869626f429bd68229c09afe (diff)
parentc078a44247d733111d1737dfc0468b105ea91d55 (diff)
downloadrust-4510ee3af35d4f5496b9a44f1168570b18d5c545.tar.gz
rust-4510ee3af35d4f5496b9a44f1168570b18d5c545.zip
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`
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/rustdoc-map-file/Makefile5
-rw-r--r--tests/run-make/rustdoc-map-file/rmake.rs15
3 files changed, 15 insertions, 6 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index f4ae7b06cdb..8ebcb439382 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -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
diff --git a/tests/run-make/rustdoc-map-file/Makefile b/tests/run-make/rustdoc-map-file/Makefile
deleted file mode 100644
index 5cbf7747af6..00000000000
--- a/tests/run-make/rustdoc-map-file/Makefile
+++ /dev/null
@@ -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"
diff --git a/tests/run-make/rustdoc-map-file/rmake.rs b/tests/run-make/rustdoc-map-file/rmake.rs
new file mode 100644
index 00000000000..aaa7fea0b6b
--- /dev/null
+++ b/tests/run-make/rustdoc-map-file/rmake.rs
@@ -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());
+}