Skip to content

Commit 32f0137

Browse files
authored
Unrolled build for #145821
Rollup merge of #145821 - lolbinarycat:compiletest-error-show, r=clubby789 compiletest: if a compiler fails, show its output Before, when working on something like a `rustdoc-js` test, if you made a syntax error in a rust file, you would not get that error output unless you ran with `--verbose`, which would also cause an enormous amount of other output to be printed as well. This can also lead to frustration in new contributors who don't think to run with `--verbose`. Now, if rustc or rustdoc is run by compiletest and produces an non-zero exit code, its output will be printed.
2 parents ace9a74 + 9567812 commit 32f0137

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ impl<'test> TestCx<'test> {
412412
cmdline: format!("{cmd:?}"),
413413
};
414414
self.dump_output(
415-
self.config.verbose,
415+
self.config.verbose || !proc_res.status.success(),
416416
&cmd.get_program().to_string_lossy(),
417417
&proc_res.stdout,
418418
&proc_res.stderr,
@@ -1486,7 +1486,7 @@ impl<'test> TestCx<'test> {
14861486
};
14871487

14881488
self.dump_output(
1489-
self.config.verbose,
1489+
self.config.verbose || (!result.status.success() && self.config.mode != TestMode::Ui),
14901490
&command.get_program().to_string_lossy(),
14911491
&result.stdout,
14921492
&result.stderr,
@@ -2987,6 +2987,7 @@ struct ProcArgs {
29872987
args: Vec<OsString>,
29882988
}
29892989

2990+
#[derive(Debug)]
29902991
pub struct ProcRes {
29912992
status: ExitStatus,
29922993
stdout: String,

0 commit comments

Comments
 (0)