Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate run-make/link-framework to rmake.rs #126898

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -46,7 +46,6 @@ run-make/libtest-json/Makefile
run-make/libtest-junit/Makefile
run-make/libtest-thread-limit/Makefile
run-make/link-cfg/Makefile
run-make/link-framework/Makefile
run-make/long-linker-command-lines-cmd-exe/Makefile
run-make/long-linker-command-lines/Makefile
run-make/lto-linkage-used-attr/Makefile
Expand Down
23 changes: 0 additions & 23 deletions tests/run-make/link-framework/Makefile

This file was deleted.

38 changes: 38 additions & 0 deletions tests/run-make/link-framework/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// 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_fail().assert_stdout_not_contains("CoreFoundation");

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

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

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