From 8167a353195322dad135a22a81a9fccf73878d6a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 10 May 2024 10:59:47 +0200 Subject: [PATCH] Migrate `run-make/rustdoc-shared-flags` to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/rustdoc-shared-flags/Makefile | 18 ------------------ tests/run-make/rustdoc-shared-flags/rmake.rs | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 tests/run-make/rustdoc-shared-flags/Makefile create mode 100644 tests/run-make/rustdoc-shared-flags/rmake.rs diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index e87950b36d9df..74592424337ad 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 a2a7d7b3634a9..0000000000000 --- 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 0000000000000..2db613f781764 --- /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"]); +}