Skip to content

Commit c77f0a4

Browse files
authored
Rollup merge of #93508 - CraftSpider:jsondocck-runtest-output, r=Mark-Simulacrum
Add rustdoc info to jsondocck output Makes debugging issues in the generated output simpler by handling emitted logs and etc.
2 parents f7e0f97 + 71249a9 commit c77f0a4

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/tools/compiletest/src/runtest.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,10 @@ impl<'test> TestCx<'test> {
24242424
);
24252425

24262426
if !res.status.success() {
2427-
self.fatal_proc_rec("jsondocck failed!", &res)
2427+
self.fatal_proc_rec_with_ctx("jsondocck failed!", &res, |_| {
2428+
println!("Rustdoc Output:");
2429+
proc_res.print_info();
2430+
})
24282431
}
24292432

24302433
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
@@ -3738,10 +3741,7 @@ pub struct ProcRes {
37383741
}
37393742

37403743
impl ProcRes {
3741-
pub fn fatal(&self, err: Option<&str>, on_failure: impl FnOnce()) -> ! {
3742-
if let Some(e) = err {
3743-
println!("\nerror: {}", e);
3744-
}
3744+
pub fn print_info(&self) {
37453745
print!(
37463746
"\
37473747
status: {}\n\
@@ -3760,6 +3760,13 @@ impl ProcRes {
37603760
json::extract_rendered(&self.stdout),
37613761
json::extract_rendered(&self.stderr),
37623762
);
3763+
}
3764+
3765+
pub fn fatal(&self, err: Option<&str>, on_failure: impl FnOnce()) -> ! {
3766+
if let Some(e) = err {
3767+
println!("\nerror: {}", e);
3768+
}
3769+
self.print_info();
37633770
on_failure();
37643771
// Use resume_unwind instead of panic!() to prevent a panic message + backtrace from
37653772
// compiletest, which is unnecessary noise.

0 commit comments

Comments
 (0)