Skip to content

Commit b7a6036

Browse files
committed
Add testcase if nightly not enabled for multiple build scripts
1 parent 1d18b6b commit b7a6036

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//! Tests for multiple build scripts feature.
2+
3+
use cargo_test_support::prelude::*;
4+
use cargo_test_support::project;
5+
use cargo_test_support::str;
6+
7+
#[cargo_test]
8+
fn build_without_nightly_aborts_with_error() {
9+
let p = project()
10+
.file(
11+
"Cargo.toml",
12+
r#"
13+
[package]
14+
name = "foo"
15+
version = "0.1.0"
16+
edition = "2024"
17+
build = ["build1.rs"]
18+
"#,
19+
)
20+
.build();
21+
p.cargo("check")
22+
.with_status(101)
23+
.with_stderr_data(str![[r#"
24+
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
25+
26+
Caused by:
27+
`build = […]` requires `-Z multiple-build-scripts`
28+
29+
"#]])
30+
.run();
31+
}

tests/testsuite/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ mod build_plan;
1616
mod build_script;
1717
mod build_script_env;
1818
mod build_script_extra_link_arg;
19+
mod build_scripts_multiple;
1920
mod cache_lock;
2021
mod cache_messages;
2122
mod cargo;

0 commit comments

Comments
 (0)