Skip to content

Commit

Permalink
Add new test case 'test_std_on_unsupported_target'
Browse files Browse the repository at this point in the history
Add a new test case to check cargo handles building a target which
doesn't support the standard library properly.
  • Loading branch information
harmou01 committed Nov 21, 2024
1 parent 5e4a1db commit 6a980bc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/testsuite/standard_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,32 @@ fn check_core() {
.run();
}

#[cargo_test(build_std_mock)]
fn test_std_on_unsupported_target() {
let setup = setup();

let p = project()
.file(
"src/main.rs",
r#"
fn main() {
println!("hello");
}
"#,
)
.build();

p.cargo("build")
.arg("--target=aarch64-unknown-none")
.arg("--target=x86_64-unknown-none")
.build_std(&setup)
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] building std is not supported on the following targets: [..]
"#]])
.run();
}

#[cargo_test(build_std_mock)]
fn depend_same_as_std() {
let setup = setup();
Expand Down

0 comments on commit 6a980bc

Please sign in to comment.