Add rustdoc info to jsondocck output

This commit is contained in:
Rune Tynan 2022-01-31 10:38:15 -05:00
parent 72e74d7b9c
commit 71249a9ef7

View File

@ -2412,7 +2412,10 @@ fn run_rustdoc_json_test(&self) {
);
if !res.status.success() {
self.fatal_proc_rec("jsondocck failed!", &res)
self.fatal_proc_rec_with_ctx("jsondocck failed!", &res, |_| {
println!("Rustdoc Output:");
proc_res.print_info();
})
}
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
@ -3759,10 +3762,7 @@ pub struct ProcRes {
}
impl ProcRes {
pub fn fatal(&self, err: Option<&str>, on_failure: impl FnOnce()) -> ! {
if let Some(e) = err {
println!("\nerror: {}", e);
}
pub fn print_info(&self) {
print!(
"\
status: {}\n\
@ -3781,6 +3781,13 @@ pub fn fatal(&self, err: Option<&str>, on_failure: impl FnOnce()) -> ! {
json::extract_rendered(&self.stdout),
json::extract_rendered(&self.stderr),
);
}
pub fn fatal(&self, err: Option<&str>, on_failure: impl FnOnce()) -> ! {
if let Some(e) = err {
println!("\nerror: {}", e);
}
self.print_info();
on_failure();
// Use resume_unwind instead of panic!() to prevent a panic message + backtrace from
// compiletest, which is unnecessary noise.