Skip to content

Commit 642db0d

Browse files
committed
[DO NOT MERGE] only verbose if rustc fails to crash
1 parent 1e5ff65 commit 642db0d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/tools/compiletest/src/runtest/crashes.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ impl TestCx<'_> {
55
let pm = self.pass_mode();
66
let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm));
77

8-
if std::env::var("COMPILETEST_VERBOSE_CRASHES").is_ok() {
9-
eprintln!("{}", proc_res.status);
10-
eprintln!("{}", proc_res.stdout);
11-
eprintln!("{}", proc_res.stderr);
12-
eprintln!("{}", proc_res.cmdline);
13-
}
14-
158
// if a test does not crash, consider it an error
169
if proc_res.status.success() || matches!(proc_res.status.code(), Some(1 | 0)) {
10+
// HACK(jieyouxu): flip it so it verbose if the test *fails* to crash.
11+
if std::env::var("COMPILETEST_VERBOSE_CRASHES").is_ok() {
12+
eprintln!("{}", proc_res.status);
13+
eprintln!("{}", proc_res.stdout);
14+
eprintln!("{}", proc_res.stderr);
15+
eprintln!("{}", proc_res.cmdline);
16+
}
17+
1718
self.fatal(&format!(
1819
"crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful \
1920
name, add a doc-comment to the start of the test explaining why it exists and \

0 commit comments

Comments
 (0)