Skip to content

Commit e319c2c

Browse files
committed
Test that the new debuginfo options match between cargo and rustc
1 parent 2015080 commit e319c2c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/testsuite/profiles.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,3 +742,36 @@ Caused by:
742742
)
743743
.run();
744744
}
745+
746+
#[cargo_test(nightly, reason = "debug options stabilized in 1.70")]
747+
fn debug_options_valid() {
748+
for (option, cli) in [
749+
("line-directives-only", "line-directives-only"),
750+
("line-tables-only", "line-tables-only"),
751+
("none", "0"),
752+
("limited", "1"),
753+
("full", "2"),
754+
] {
755+
let p = project()
756+
.file(
757+
"Cargo.toml",
758+
&format!(
759+
r#"
760+
[package]
761+
name = "foo"
762+
authors = []
763+
version = "0.0.0"
764+
765+
[profile.dev]
766+
debug = "{option}"
767+
"#
768+
),
769+
)
770+
.file("src/main.rs", "fn main() {}")
771+
.build();
772+
773+
p.cargo("build -v")
774+
.with_stderr_contains(&format!("[RUNNING] `rustc [..]-C debuginfo={cli} [..]"))
775+
.run();
776+
}
777+
}

0 commit comments

Comments
 (0)