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```
This commit is contained in:
Matthias Krüger 2024-05-11 23:43:25 +02:00 committed by GitHub
commit 864fce55fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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"]);
}