Skip to content

Commit

Permalink
Auto merge of #12022 - jyn514:debuginfo-tests, r=weihanglo
Browse files Browse the repository at this point in the history
Test that the new `debuginfo` options match between cargo and rustc

As requested in #11958 (comment).

r? `@ehuss`
  • Loading branch information
bors committed May 24, 2023
2 parents 64fb38c + e319c2c commit 092db78
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 092db78

Please sign in to comment.