Skip to content

Commit

Permalink
Migrate run-make/link-framework to rmake.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 24, 2024
1 parent 2c243d9 commit dd7d6b0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ run-make/libtest-junit/Makefile
run-make/libtest-padding/Makefile
run-make/libtest-thread-limit/Makefile
run-make/link-cfg/Makefile
run-make/link-framework/Makefile
run-make/link-path-order/Makefile
run-make/linkage-attr-on-static/Makefile
run-make/llvm-ident/Makefile
Expand Down
23 changes: 0 additions & 23 deletions tests/run-make/link-framework/Makefile

This file was deleted.

29 changes: 29 additions & 0 deletions tests/run-make/link-framework/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Check that linking to a framework actually makes it to the linker.

//@ only-apple

use run_make_support::{cmd, rustc};

fn main() {
rustc().input("dep-link-framework.rs").run();
rustc().input("dep-link-weak-framework.rs").run();

rustc().input("empty.rs").run();
cmd("otool").arg("-L").arg("no-link").run().assert_stdout_not_contains("CoreFoundation");

rustc().input("link-framework.rs").run();
let out = cmd("otool").arg("-L").arg("link-framework").run();
out.assert_stdout_contains("CoreFoundation");
out.assert_stdout_not_contains("weak");

rustc().input("link-weak-framework.rs").run();
let out = cmd("otool").arg("-L").arg("link-weak-framework").run();
out.assert_stdout_contains("CoreFoundation");
out.assert_stdout_contains("weak");

// When linking the framework both normally, and weakly, the weak linking takes preference.
rustc().input("link-both.rs").run();
let out = cmd("otool").arg("-L").arg("link-both").run();
out.assert_stdout_contains("CoreFoundation");
out.assert_stdout_contains("weak");
}

0 comments on commit dd7d6b0

Please sign in to comment.