Skip to content

Commit 6cd8e87

Browse files
committed
tests: profile_custom - test for invalid 'inherits' use on root profile
1 parent a2b7197 commit 6cd8e87

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/testsuite/profile_custom.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
use cargo_test_support::{basic_lib_manifest, project};
22

3+
#[cargo_test]
4+
fn inherits_on_release() {
5+
let p = project()
6+
.file(
7+
"Cargo.toml",
8+
r#"
9+
cargo-features = ["named-profiles"]
10+
11+
[package]
12+
name = "foo"
13+
version = "0.0.1"
14+
authors = []
15+
16+
[profile.release]
17+
inherits = "dev"
18+
"#,
19+
)
20+
.file("src/lib.rs", "")
21+
.build();
22+
23+
p.cargo("build")
24+
.masquerade_as_nightly_cargo()
25+
.with_status(101)
26+
.with_stderr(
27+
"\
28+
[ERROR] failed to parse manifest at [..]
29+
30+
Caused by:
31+
An 'inherits' must not specified root profile 'release'
32+
"
33+
)
34+
.run();
35+
}
36+
337
#[cargo_test]
438
fn missing_inherits() {
539
let p = project()

0 commit comments

Comments
 (0)