Skip to content

Commit e960ecb

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

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/testsuite/build.rs

+33
Original file line numberDiff line numberDiff line change
@@ -6407,3 +6407,36 @@ fn renamed_uplifted_artifact_remains_unmodified_after_rebuild() {
64076407
let not_the_same = !same_file::is_same_file(bin, renamed_bin).unwrap();
64086408
assert!(not_the_same, "renamed uplifted artifact must be unmodified");
64096409
}
6410+
6411+
#[cargo_test(nightly, reason = "debug options stabilized in 1.70")]
6412+
fn debug_options_valid() {
6413+
for (option, cli) in [
6414+
("line-directives-only", "line-directives-only"),
6415+
("line-tables-only", "line-tables-only"),
6416+
("none", "0"),
6417+
("limited", "1"),
6418+
("full", "2"),
6419+
] {
6420+
let p = project()
6421+
.file(
6422+
"Cargo.toml",
6423+
&format!(
6424+
r#"
6425+
[package]
6426+
name = "foo"
6427+
authors = []
6428+
version = "0.0.0"
6429+
6430+
[profile.dev]
6431+
debug = "{option}"
6432+
"#
6433+
),
6434+
)
6435+
.file("src/main.rs", "fn main() {}")
6436+
.build();
6437+
6438+
p.cargo("build -v")
6439+
.with_stderr_contains(&format!("[RUNNING] `rustc [..]-C debuginfo={cli} [..]"))
6440+
.run();
6441+
}
6442+
}

0 commit comments

Comments
 (0)