Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rustdoc info to jsondocck output #93508

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,10 @@ impl<'test> TestCx<'test> {
);

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());
Expand Down Expand Up @@ -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\
Expand All @@ -3781,6 +3781,13 @@ impl ProcRes {
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.
Expand Down