@@ -581,6 +581,16 @@ impl TestProps {
581581self . incremental = true ;
582582}
583583
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+
584594for key in & [ "RUST_TEST_NOCAPTURE" , "RUST_TEST_THREADS" ] {
585595if let Ok ( val) = env:: var ( key) {
586596if self . exec_env . iter ( ) . find ( |& & ( ref x, _) | x == key) . is_none ( ) {
@@ -596,7 +606,8 @@ impl TestProps {
596606
597607fn update_fail_mode ( & mut self , ln : & str , config : & Config ) {
598608let 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 {
600611panic ! ( "`{}-fail` header is only supported in UI tests" , mode) ;
601612}
602613} ;
@@ -625,7 +636,7 @@ impl TestProps {
625636fn update_pass_mode ( & mut self , ln : & str , revision : Option < & str > , config : & Config ) {
626637let check_no_run = |s| match ( config. mode , s) {
627638( Mode :: Ui , _) => ( ) ,
628- ( Mode :: Crashes , "should-ice" ) => ( ) ,
639+ ( Mode :: Crashes , _ ) => ( ) ,
629640( Mode :: Codegen , "build-pass" ) => ( ) ,
630641( Mode :: Incremental , _) => {
631642if revision. is_some ( ) && !self . revisions . iter ( ) . all ( |r| r. starts_with ( "cfail" ) ) {
0 commit comments