@@ -581,6 +581,16 @@ impl TestProps {
581
581
self . incremental = true ;
582
582
}
583
583
584
+ if config. mode == Mode :: Crashes {
585
+ // we don't want to pollute anything with backtrace-files
586
+ // also turn off backtraces in order to save some execution
587
+ // time on the tests; we only need to know IF it crashes
588
+ self . rustc_env = vec ! [
589
+ ( "RUST_BACKTRACE" . to_string( ) , "0" . to_string( ) ) ,
590
+ ( "RUSTC_ICE" . to_string( ) , "0" . to_string( ) ) ,
591
+ ] ;
592
+ }
593
+
584
594
for key in & [ "RUST_TEST_NOCAPTURE" , "RUST_TEST_THREADS" ] {
585
595
if let Ok ( val) = env:: var ( key) {
586
596
if self . exec_env . iter ( ) . find ( |& & ( ref x, _) | x == key) . is_none ( ) {
@@ -596,7 +606,8 @@ impl TestProps {
596
606
597
607
fn update_fail_mode ( & mut self , ln : & str , config : & Config ) {
598
608
let check_ui = |mode : & str | {
599
- if config. mode != Mode :: Ui {
609
+ // Mode::Crashes may need build-fail in order to trigger llvm errors or stack overflows
610
+ if config. mode != Mode :: Ui && config. mode != Mode :: Crashes {
600
611
panic ! ( "`{}-fail` header is only supported in UI tests" , mode) ;
601
612
}
602
613
} ;
@@ -625,7 +636,7 @@ impl TestProps {
625
636
fn update_pass_mode ( & mut self , ln : & str , revision : Option < & str > , config : & Config ) {
626
637
let check_no_run = |s| match ( config. mode , s) {
627
638
( Mode :: Ui , _) => ( ) ,
628
- ( Mode :: Crashes , "should-ice" ) => ( ) ,
639
+ ( Mode :: Crashes , _ ) => ( ) ,
629
640
( Mode :: Codegen , "build-pass" ) => ( ) ,
630
641
( Mode :: Incremental , _) => {
631
642
if revision. is_some ( ) && !self . revisions . iter ( ) . all ( |r| r. starts_with ( "cfail" ) ) {
0 commit comments