1use super::{TestCx, WillExecute};
23impl TestCx<'_> {
4pub(super) fn run_crash_test(&self) {
5let pm = self.pass_mode();
6let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm));
78if std::env::var("COMPILETEST_VERBOSE_CRASHES").is_ok() {
9eprintln!("{}", proc_res.status);
10eprintln!("{}", proc_res.stdout);
11eprintln!("{}", proc_res.stderr);
12eprintln!("{}", proc_res.cmdline);
13 }
1415// if a test does not crash, consider it an error
16if proc_res.status.success() || matches!(proc_res.status.code(), Some(1 | 0)) {
17self.fatal(&format!(
18"crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful \
19 name, add a doc-comment to the start of the test explaining why it exists and \
20 move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR \
21 description ensures that the corresponding ticket is auto-closed upon merge. \
22 If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
23));
24 }
25 }
26}