mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Auto merge of #12022 - jyn514:debuginfo-tests, r=weihanglo
Test that the new `debuginfo` options match between cargo and rustc As requested in https://github.com/rust-lang/cargo/pull/11958#issuecomment-1518684469. r? `@ehuss`
This commit is contained in:
commit
092db788d1
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user