Skip to content

Commit 71249a9

Browse files
committed
Add rustdoc info to jsondocck output
1 parent 72e74d7 commit 71249a9

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
@@ -2412,7 +2412,10 @@ impl<'test> TestCx<'test> {
24122412
);
24132413

24142414
if !res.status.success() {
2415-
self.fatal_proc_rec("jsondocck failed!", &res)
2415+
self.fatal_proc_rec_with_ctx("jsondocck failed!", &res, |_| {
2416+
println!("Rustdoc Output:");
2417+
proc_res.print_info();
2418+
})
24162419
}
24172420

24182421
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
@@ -3759,10 +3762,7 @@ pub struct ProcRes {
37593762
}
37603763

37613764
impl ProcRes {
3762-
pub fn fatal(&self, err: Option<&str>, on_failure: impl FnOnce()) -> ! {
3763-
if let Some(e) = err {
3764-
println!("\nerror: {}", e);
3765-
}
3765+
pub fn print_info(&self) {
37663766
print!(
37673767
"\
37683768
status: {}\n\
@@ -3781,6 +3781,13 @@ impl ProcRes {
37813781
json::extract_rendered(&self.stdout),
37823782
json::extract_rendered(&self.stderr),
37833783
);
3784+
}
3785+
3786+
pub fn fatal(&self, err: Option<&str>, on_failure: impl FnOnce()) -> ! {
3787+
if let Some(e) = err {
3788+
println!("\nerror: {}", e);
3789+
}
3790+
self.print_info();
37843791
on_failure();
37853792
// Use resume_unwind instead of panic!() to prevent a panic message + backtrace from
37863793
// compiletest, which is unnecessary noise.

0 commit comments

Comments
 (0)