about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-06-23 15:12:17 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-06-27 14:04:45 +0200
commit449cde32ade77758359fcd83e0f6ac7a191b70f0 (patch)
tree3fa473a9c363b314f32cb6820a38fe7b8003a4e0
parent84146b372ab5b9bc3a6e21719750d7f2f66ceb8d (diff)
downloadrust-449cde32ade77758359fcd83e0f6ac7a191b70f0.tar.gz
rust-449cde32ade77758359fcd83e0f6ac7a191b70f0.zip
Migrate `run-make/invalid-library` to `rmake.rs`
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/invalid-library/Makefile6
-rw-r--r--tests/run-make/invalid-library/rmake.rs8
3 files changed, 8 insertions, 7 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index cb68589d8a4..2bc3acc58cb 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -54,7 +54,6 @@ run-make/incr-add-rust-src-component/Makefile
 run-make/incr-foreign-head-span/Makefile
 run-make/interdependent-c-libraries/Makefile
 run-make/intrinsic-unreachable/Makefile
-run-make/invalid-library/Makefile
 run-make/issue-107094/Makefile
 run-make/issue-109934-lto-debuginfo/Makefile
 run-make/issue-14698/Makefile
diff --git a/tests/run-make/invalid-library/Makefile b/tests/run-make/invalid-library/Makefile
deleted file mode 100644
index 910d9af7b05..00000000000
--- a/tests/run-make/invalid-library/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-include ../tools.mk
-
-all:
-	touch $(TMPDIR)/lib.rmeta
-	$(AR) crus $(TMPDIR)/libfoo-ffffffff-1.0.rlib $(TMPDIR)/lib.rmeta
-	$(RUSTC) foo.rs 2>&1 | $(CGREP) "found invalid metadata"
diff --git a/tests/run-make/invalid-library/rmake.rs b/tests/run-make/invalid-library/rmake.rs
new file mode 100644
index 00000000000..e76b3f3b5d2
--- /dev/null
+++ b/tests/run-make/invalid-library/rmake.rs
@@ -0,0 +1,8 @@
+use run_make_support::fs_wrapper::create_file;
+use run_make_support::{ar_command, rustc};
+
+fn main() {
+    create_file("lib.rmeta");
+    ar_command().arg("crus").arg("libfoo-ffffffff-1.0.rlib").arg("lib.rmeta").run();
+    rustc().input("foo.rs").run_fail().assert_stderr_contains("found invalid metadata");
+}