This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -364,16 +364,21 @@ impl<'test> TestCx<'test> {
364
364
fn run_crash_test ( & self ) {
365
365
let pm = self . pass_mode ( ) ;
366
366
let proc_res = self . compile_test ( WillExecute :: No , self . should_emit_metadata ( pm) ) ;
367
- /*
368
- eprintln!("{}", proc_res.status);
369
- eprintln!("{}", proc_res.stdout);
370
- eprintln!("{}", proc_res.stderr);
371
- eprintln!("{}", proc_res.cmdline);
372
- */
367
+
368
+ if std:: env:: var ( "COMPILETEST_VERBOSE_CRASHES" ) . is_ok ( ) {
369
+ eprintln ! ( "{}" , proc_res. status) ;
370
+ eprintln ! ( "{}" , proc_res. stdout) ;
371
+ eprintln ! ( "{}" , proc_res. stderr) ;
372
+ eprintln ! ( "{}" , proc_res. cmdline) ;
373
+ }
373
374
374
375
// if a test does not crash, consider it an error
375
376
if proc_res. status . success ( ) || matches ! ( proc_res. status. code( ) , Some ( 1 | 0 ) ) {
376
- self . fatal ( & format ! ( "test no longer crashes/triggers ICE! Please annotate it and add it as test to tests/ui or wherever you see fit" ) ) ;
377
+ self . fatal ( & format ! (
378
+ "test no longer crashes/triggers ICE! Please give it a mearningful name, \
379
+ add a doc-comment to the start of the test explaining why it exists and \
380
+ move it to tests/ui or wherever you see fit."
381
+ ) ) ;
377
382
}
378
383
}
379
384
Original file line number Diff line number Diff line change @@ -10,4 +10,7 @@ When adding crashes from https://github.com/rust-lang/rust/issues, the
10
10
issue number should be noted in the file name (12345.rs should suffice)
11
11
and perhaps also inside the file via ` //@ known-bug #4321 `
12
12
13
- If you happen to fix one of the crashes, please move it to ` tests/ui ` ! :)
13
+ If you happen to fix one of the crashes, please move it to a fitting
14
+ subdirectory in ` tests/ui ` and give it a meaningful name.
15
+ Also please add a doc comment at the top of the file explaining why
16
+ this test exists. :)
You can’t perform that action at this time.
0 commit comments