From db21af1a72926571427dd62b51bb1757e88ae64b Mon Sep 17 00:00:00 2001 From: Oneirical Date: Wed, 26 Jun 2024 15:33:27 -0400 Subject: [PATCH] rewrite metadata-dep-info to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/metadata-dep-info/Makefile | 7 ------- ...dash-separated_something-extra.expected.d} | 0 tests/run-make/metadata-dep-info/rmake.rs | 20 +++++++++++++++++++ 4 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 tests/run-make/metadata-dep-info/Makefile rename tests/run-make/metadata-dep-info/{dash-separated_something-extra.normalized.d => dash-separated_something-extra.expected.d} (100%) create mode 100644 tests/run-make/metadata-dep-info/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 b23a6cb85c0..e2ebdbca281 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -98,7 +98,6 @@ run-make/lto-smoke-c/Makefile run-make/macos-deployment-target/Makefile run-make/macos-fat-archive/Makefile run-make/manual-link/Makefile -run-make/metadata-dep-info/Makefile run-make/min-global-align/Makefile run-make/mingw-export-call-convention/Makefile run-make/mismatching-target-triples/Makefile diff --git a/tests/run-make/metadata-dep-info/Makefile b/tests/run-make/metadata-dep-info/Makefile deleted file mode 100644 index d48cbe0f295..00000000000 --- a/tests/run-make/metadata-dep-info/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --emit=metadata,dep-info --crate-type lib dash-separated.rs -C extra-filename=_something-extra - # Strip TMPDIR since it is a machine specific absolute path - sed "s%.*[/\\]%%" "$(TMPDIR)"/dash-separated_something-extra.d > "$(TMPDIR)"/dash-separated_something-extra.normalized.d - $(RUSTC_TEST_OP) "$(TMPDIR)"/dash-separated_something-extra.normalized.d dash-separated_something-extra.normalized.d diff --git a/tests/run-make/metadata-dep-info/dash-separated_something-extra.normalized.d b/tests/run-make/metadata-dep-info/dash-separated_something-extra.expected.d similarity index 100% rename from tests/run-make/metadata-dep-info/dash-separated_something-extra.normalized.d rename to tests/run-make/metadata-dep-info/dash-separated_something-extra.expected.d diff --git a/tests/run-make/metadata-dep-info/rmake.rs b/tests/run-make/metadata-dep-info/rmake.rs new file mode 100644 index 00000000000..f4bb3ea63fb --- /dev/null +++ b/tests/run-make/metadata-dep-info/rmake.rs @@ -0,0 +1,20 @@ +// Emitting dep-info alongside metadata would present subtle discrepancies +// in the output file, such as the filename transforming underscores_ into hyphens-. +// After the fix in #114750, this test checks that the emitted files are identical +// to the expected output. +// See https://github.com/rust-lang/rust/issues/68839 + +use run_make_support::{diff, rustc}; + +fn main() { + rustc() + .emit("metadata,dep-info") + .crate_type("lib") + .input("dash-separated.rs") + .extra_filename("_something-extra") + .run(); + diff() + .expected_file("dash-separated_something-extra.expected.d") + .actual_file("dash-separated_something-extra.d") + .run(); +}