about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-06-08 23:17:11 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-06-11 14:11:30 +0200
commit19a2dfea881568fb63e55e8535634ad33c783f02 (patch)
tree1f2772da9b8fb8a30f057ab02366e2ebb742ae7a
parentd402830c8a356332de93761d6996faf5a2ca29ca (diff)
downloadrust-19a2dfea881568fb63e55e8535634ad33c783f02.tar.gz
rust-19a2dfea881568fb63e55e8535634ad33c783f02.zip
Migrate `tests/run-make/prefer-dylib` to `rmake.rs`
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/prefer-dylib/Makefile9
-rw-r--r--tests/run-make/prefer-dylib/rmake.rs16
3 files changed, 16 insertions, 10 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index a015f96ae51..fb65c96c4aa 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -177,7 +177,6 @@ run-make/pgo-gen/Makefile
 run-make/pgo-indirect-call-promotion/Makefile
 run-make/pgo-use/Makefile
 run-make/pointer-auth-link-with-c/Makefile
-run-make/prefer-dylib/Makefile
 run-make/prefer-rlib/Makefile
 run-make/pretty-print-to-file/Makefile
 run-make/pretty-print-with-dep-file/Makefile
diff --git a/tests/run-make/prefer-dylib/Makefile b/tests/run-make/prefer-dylib/Makefile
deleted file mode 100644
index cc26e70ae67..00000000000
--- a/tests/run-make/prefer-dylib/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all:
-	$(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib -C prefer-dynamic
-	$(RUSTC) foo.rs -C prefer-dynamic
-	$(call RUN,foo)
-	rm $(TMPDIR)/*bar*
-	$(call FAIL,foo)
diff --git a/tests/run-make/prefer-dylib/rmake.rs b/tests/run-make/prefer-dylib/rmake.rs
new file mode 100644
index 00000000000..ad9fd8a15a2
--- /dev/null
+++ b/tests/run-make/prefer-dylib/rmake.rs
@@ -0,0 +1,16 @@
+//@ ignore-cross-compile
+
+use run_make_support::{cwd, dynamic_lib_name, read_dir, run, run_fail, rustc};
+use std::fs::remove_file;
+use std::process::Command;
+
+fn main() {
+    rustc().input("bar.rs").crate_type("dylib").crate_type("rlib").arg("-Cprefer-dynamic").run();
+    rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
+
+    run("foo");
+
+    remove_file(dynamic_lib_name("bar")).unwrap();
+    // This time the command should fail.
+    run_fail("foo");
+}