Skip to content

Commit 036ed3a

Browse files
committed
test(cfg): parse rustc --print=split-debuginfo
1 parent 30fe923 commit 036ed3a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/testsuite/cfg.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,22 @@ fn bad_cfg_discovery() {
356356
return;
357357
}
358358
println!("{}", sysroot);
359+
360+
if mode == "no-split-debuginfo" {
361+
return;
362+
}
363+
loop {
364+
let line = lines.next().unwrap();
365+
if line == "___" {
366+
println!("\n{line}");
367+
break;
368+
} else {
369+
// As the number split-debuginfo options varies,
370+
// concat them into one line.
371+
print!("{line},");
372+
}
373+
};
374+
359375
if mode != "bad-cfg" {
360376
panic!("unexpected");
361377
}
@@ -412,6 +428,28 @@ command was: `[..]compiler[..]--crate-type [..]`
412428
[..]___[..]
413429
[..]___[..]
414430
431+
",
432+
)
433+
.run();
434+
435+
p.cargo("build")
436+
.env("RUSTC", &funky_rustc)
437+
.env("FUNKY_MODE", "no-split-debuginfo")
438+
.with_status(101)
439+
.with_stderr(
440+
"\
441+
[ERROR] output of --print=split-debuginfo missing when learning about target-specific information from rustc
442+
command was: `[..]compiler[..]--crate-type [..]`
443+
444+
--- stdout
445+
[..]___[..]
446+
[..]___[..]
447+
[..]___[..]
448+
[..]___[..]
449+
[..]___[..]
450+
[..]___[..]
451+
[..]
452+
415453
",
416454
)
417455
.run();
@@ -430,6 +468,8 @@ command was: `[..]compiler[..]--crate-type [..]`
430468
[..]___[..]
431469
[..]___[..]
432470
[..]
471+
[..],[..]
472+
___
433473
123
434474
435475

0 commit comments

Comments
 (0)