Skip to content

Migrate run-make/link-arg to rmake.rs #126120

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

Closed
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 @@ -114,7 +114,6 @@ run-make/libtest-json/Makefile
run-make/libtest-junit/Makefile
run-make/libtest-padding/Makefile
run-make/libtest-thread-limit/Makefile
run-make/link-arg/Makefile
run-make/link-args-order/Makefile
run-make/link-cfg/Makefile
run-make/link-dedup/Makefile
Expand Down
5 changes: 0 additions & 5 deletions tests/run-make/link-arg/Makefile

This file was deleted.

13 changes: 13 additions & 0 deletions tests/run-make/link-arg/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use run_make_support::{rustc, tmp_dir};

fn main() {
let out = rustc()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new run-make API, this would looks like this:

let out = rustc()
        .link_arg("-lfoo")
        .link_arg("-lbar")
        .print("link-args")
        .input("empty.rs")
        .run();
out.assert_stdout_contains("lfoo");
out.assert_stdout_contains("lbar");
  • assert_stdout_contains should be added here.

.link_arg("-lfoo")
.link_arg("-lbar")
.print("link-args")
.input("empty.rs")
.command_output();
let out = String::from_utf8(out.stdout).unwrap();
assert!(out.contains("lfoo"), "output doesn't contain `lfoo`");
assert!(out.contains("lbar"), "output doesn't contain `lbar`");
}
Loading