about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-06-26 15:33:27 -0400
committerOneirical <manchot@videotron.ca>2024-06-28 16:45:29 -0400
commitdb21af1a72926571427dd62b51bb1757e88ae64b (patch)
tree62ad6269c4098225f4dcb3be027cbc4decaf8781
parent11ac258a5f5af5fe00cc68a598414a48661a28ce (diff)
downloadrust-db21af1a72926571427dd62b51bb1757e88ae64b.tar.gz
rust-db21af1a72926571427dd62b51bb1757e88ae64b.zip
rewrite metadata-dep-info to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/metadata-dep-info/Makefile7
-rw-r--r--tests/run-make/metadata-dep-info/dash-separated_something-extra.expected.d (renamed from tests/run-make/metadata-dep-info/dash-separated_something-extra.normalized.d)0
-rw-r--r--tests/run-make/metadata-dep-info/rmake.rs20
4 files changed, 20 insertions, 8 deletions
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
index 497d76b4ea1..497d76b4ea1 100644
--- 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
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();
+}