about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-05-11 23:43:25 +0200
committerGitHub <noreply@github.com>2024-05-11 23:43:25 +0200
commit864fce55fe68470caa8c95541712d3d504ae457f (patch)
tree2e35c4423b2f7c895f2c5c1d77a704042aed6a8f
parentbeef3607ba5e0bd5ef71027a48c0eccd2d7227c6 (diff)
parent8167a353195322dad135a22a81a9fccf73878d6a (diff)
downloadrust-864fce55fe68470caa8c95541712d3d504ae457f.tar.gz
rust-864fce55fe68470caa8c95541712d3d504ae457f.zip
Rollup merge of #124963 - GuillaumeGomez:migrate-rustdoc-shared-flags, r=jieyouxu
Migrate `run-make/rustdoc-shared-flags` 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-shared-flags/Makefile18
-rw-r--r--tests/run-make/rustdoc-shared-flags/rmake.rs14
3 files changed, 14 insertions, 19 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index e87950b36d9..74592424337 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -252,7 +252,6 @@ run-make/rustdoc-scrape-examples-ordering/Makefile
 run-make/rustdoc-scrape-examples-remap/Makefile
 run-make/rustdoc-scrape-examples-test/Makefile
 run-make/rustdoc-scrape-examples-whitespace/Makefile
-run-make/rustdoc-shared-flags/Makefile
 run-make/rustdoc-target-spec-json-path/Makefile
 run-make/rustdoc-themes/Makefile
 run-make/rustdoc-verify-output-files/Makefile
diff --git a/tests/run-make/rustdoc-shared-flags/Makefile b/tests/run-make/rustdoc-shared-flags/Makefile
deleted file mode 100644
index a2a7d7b3634..00000000000
--- a/tests/run-make/rustdoc-shared-flags/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-include ../tools.mk
-
-all: z_help c_help list_passes
-
-c_help:
-	$(RUSTC) -C help > $(TMPDIR)/rustc.c_help.txt
-	$(RUSTDOC) -C help > $(TMPDIR)/rustdoc.c_help.txt
-	$(DIFF) $(TMPDIR)/rustc.c_help.txt $(TMPDIR)/rustdoc.c_help.txt
-
-z_help:
-	$(RUSTC) -Z help > $(TMPDIR)/rustc.z_help.txt
-	$(RUSTDOC) -Z help > $(TMPDIR)/rustdoc.z_help.txt
-	$(DIFF) $(TMPDIR)/rustc.z_help.txt $(TMPDIR)/rustdoc.z_help.txt
-
-list_passes:
-	$(RUSTC) -C passes=list > $(TMPDIR)/rustc.passes.txt
-	$(RUSTDOC) -C passes=list > $(TMPDIR)/rustdoc.passes.txt
-	$(DIFF) $(TMPDIR)/rustc.passes.txt $(TMPDIR)/rustdoc.passes.txt
diff --git a/tests/run-make/rustdoc-shared-flags/rmake.rs b/tests/run-make/rustdoc-shared-flags/rmake.rs
new file mode 100644
index 00000000000..2db613f7817
--- /dev/null
+++ b/tests/run-make/rustdoc-shared-flags/rmake.rs
@@ -0,0 +1,14 @@
+use run_make_support::{rustc, rustdoc, Diff};
+
+fn compare_outputs(args: &[&str]) {
+    let rustc_output = String::from_utf8(rustc().args(args).command_output().stdout).unwrap();
+    let rustdoc_output = String::from_utf8(rustdoc().args(args).command_output().stdout).unwrap();
+
+    Diff::new().expected_text("rustc", rustc_output).actual_text("rustdoc", rustdoc_output).run();
+}
+
+fn main() {
+    compare_outputs(&["-C", "help"]);
+    compare_outputs(&["-Z", "help"]);
+    compare_outputs(&["-C", "passes=list"]);
+}