Skip to content

Commit

Permalink
Test that the new debuginfo options match between cargo and rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed May 24, 2023
1 parent 2015080 commit e319c2c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/testsuite/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,3 +742,36 @@ Caused by:
)
.run();
}

#[cargo_test(nightly, reason = "debug options stabilized in 1.70")]
fn debug_options_valid() {
for (option, cli) in [
("line-directives-only", "line-directives-only"),
("line-tables-only", "line-tables-only"),
("none", "0"),
("limited", "1"),
("full", "2"),
] {
let p = project()
.file(
"Cargo.toml",
&format!(
r#"
[package]
name = "foo"
authors = []
version = "0.0.0"
[profile.dev]
debug = "{option}"
"#
),
)
.file("src/main.rs", "fn main() {}")
.build();

p.cargo("build -v")
.with_stderr_contains(&format!("[RUNNING] `rustc [..]-C debuginfo={cli} [..]"))
.run();
}
}

0 comments on commit e319c2c

Please sign in to comment.