Skip to content

Commit

Permalink
test(script): Verify existing build.rs behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 17, 2023
1 parent 0d5370a commit 4427cfe
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testsuite/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,30 @@ fn main() {
.run();
}

#[cargo_test]
fn test_no_build_rs() {
let script = r#"#!/usr/bin/env cargo
fn main() {
println!("Hello world!");
}"#;
let p = cargo_test_support::project()
.file("script.rs", script)
.file("build.rs", "broken")
.build();

p.cargo("-Zscript script.rs --help")
.masquerade_as_nightly_cargo(&["script"])
.with_status(101)
.with_stdout(r#""#)
.with_stderr_contains(
"\
[ERROR] could not compile `script` (build script) due to previous error
",
)
.run();
}

#[cargo_test]
fn test_no_autobins() {
let script = r#"#!/usr/bin/env cargo
Expand Down

0 comments on commit 4427cfe

Please sign in to comment.