Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6dc5705

Browse files
committedMar 21, 2025
set --target for a few tests
1 parent 5fe1e47 commit 6dc5705

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
 

‎tests/run-make/doctests-keep-binaries/rmake.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
use std::path::Path;
55

66
use run_make_support::rfs::{create_dir, remove_dir_all};
7-
use run_make_support::{run, rustc, rustdoc};
7+
use run_make_support::{run, rustc, rustdoc, target};
88

99
fn setup_test_env<F: FnOnce(&Path, &Path)>(callback: F) {
1010
let out_dir = Path::new("doctests");
1111
create_dir(&out_dir);
12-
rustc().input("t.rs").crate_type("rlib").run();
12+
rustc().target(target()).input("t.rs").crate_type("rlib").run();
1313
callback(&out_dir, Path::new("libt.rlib"));
1414
remove_dir_all(out_dir);
1515
}
@@ -22,6 +22,7 @@ fn check_generated_binaries() {
2222
fn main() {
2323
setup_test_env(|out_dir, extern_path| {
2424
rustdoc()
25+
.target(target())
2526
.input("t.rs")
2627
.arg("-Zunstable-options")
2728
.arg("--test")
@@ -33,6 +34,7 @@ fn main() {
3334
});
3435
setup_test_env(|out_dir, extern_path| {
3536
rustdoc()
37+
.target(target())
3638
.input("t.rs")
3739
.arg("-Zunstable-options")
3840
.arg("--test")
@@ -49,6 +51,7 @@ fn main() {
4951
create_dir(&run_dir_path);
5052

5153
rustdoc()
54+
.target(target())
5255
.input("t.rs")
5356
.arg("-Zunstable-options")
5457
.arg("--test")

‎tests/run-make/target-cpu-native/rmake.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
// warnings when used, and that binaries produced by it can also be successfully executed.
44
// See https://github.com/rust-lang/rust/pull/23238
55

6-
use run_make_support::{run, rustc};
6+
use run_make_support::{run, rustc, target};
77

88
fn main() {
9-
let out = rustc().input("foo.rs").arg("-Ctarget-cpu=native").run().stderr_utf8();
9+
let out =
10+
rustc().target(target()).input("foo.rs").arg("-Ctarget-cpu=native").run().stderr_utf8();
1011
run("foo");
1112
// There should be zero warnings emitted - the bug would cause "unknown CPU `native`"
1213
// to be printed out.

0 commit comments

Comments
 (0)
Failed to load comments.