]> git.proxmox.com Git - cargo.git/commitdiff
tests: profile_custom - test for invalid 'inherits' use on root profile
authorDan Aloni <dan@kernelim.com>
Sat, 21 Sep 2019 06:27:14 +0000 (09:27 +0300)
committerDan Aloni <dan@kernelim.com>
Sat, 21 Sep 2019 06:37:06 +0000 (09:37 +0300)
tests/testsuite/profile_custom.rs

index cb5f1dbacc8cfa8d974e694c53fb634f7bf044c3..738468fbf4d99c9a3bd452f9c9ddd3ce1afc90d8 100644 (file)
@@ -1,5 +1,39 @@
 use cargo_test_support::{basic_lib_manifest, project};
 
+#[cargo_test]
+fn inherits_on_release() {
+    let p = project()
+        .file(
+            "Cargo.toml",
+            r#"
+            cargo-features = ["named-profiles"]
+
+            [package]
+            name = "foo"
+            version = "0.0.1"
+            authors = []
+
+            [profile.release]
+            inherits = "dev"
+        "#,
+        )
+        .file("src/lib.rs", "")
+        .build();
+
+    p.cargo("build")
+        .masquerade_as_nightly_cargo()
+        .with_status(101)
+        .with_stderr(
+            "\
+[ERROR] failed to parse manifest at [..]
+
+Caused by:
+  An 'inherits' must not specified root profile 'release'
+"
+        )
+        .run();
+}
+
 #[cargo_test]
 fn missing_inherits() {
     let p = project()