@@ -278,13 +278,15 @@ impl<'test> TestCx<'test> {
278278 Incremental => {
279279 let revision =
280280 self . revision . expect ( "incremental tests require a list of revisions" ) ;
281- if revision. starts_with ( "rpass" ) || revision. starts_with ( "rfail" ) {
281+ if revision. starts_with ( "cpass" )
282+ || revision. starts_with ( "rpass" )
283+ || revision. starts_with ( "rfail" )
284+ {
282285 true
283286 } else if revision. starts_with ( "cfail" ) {
284- // FIXME: would be nice if incremental revs could start with "cpass"
285287 pm. is_some ( )
286288 } else {
287- panic ! ( "revision name must begin with rpass, rfail, or cfail" ) ;
289+ panic ! ( "revision name must begin with cpass, rpass, rfail, or cfail" ) ;
288290 }
289291 }
290292 mode => panic ! ( "unimplemented for mode {:?}" , mode) ,
@@ -384,6 +386,20 @@ impl<'test> TestCx<'test> {
384386 }
385387 }
386388
389+ fn run_cpass_test ( & self ) {
390+ let emit_metadata = self . should_emit_metadata ( self . pass_mode ( ) ) ;
391+ let proc_res = self . compile_test ( WillExecute :: No , emit_metadata) ;
392+
393+ if !proc_res. status . success ( ) {
394+ self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
395+ }
396+
397+ // FIXME(#41968): Move this check to tidy?
398+ if !errors:: load_errors ( & self . testpaths . file , self . revision ) . is_empty ( ) {
399+ self . fatal ( "compile-pass tests with expected warnings should be moved to ui/" ) ;
400+ }
401+ }
402+
387403 fn run_rpass_test ( & self ) {
388404 let emit_metadata = self . should_emit_metadata ( self . pass_mode ( ) ) ;
389405 let should_run = self . run_if_enabled ( ) ;
@@ -393,17 +409,15 @@ impl<'test> TestCx<'test> {
393409 self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
394410 }
395411
412+ // FIXME(#41968): Move this check to tidy?
413+ if !errors:: load_errors ( & self . testpaths . file , self . revision ) . is_empty ( ) {
414+ self . fatal ( "run-pass tests with expected warnings should be moved to ui/" ) ;
415+ }
416+
396417 if let WillExecute :: Disabled = should_run {
397418 return ;
398419 }
399420
400- // FIXME(#41968): Move this check to tidy?
401- let expected_errors = errors:: load_errors ( & self . testpaths . file , self . revision ) ;
402- assert ! (
403- expected_errors. is_empty( ) ,
404- "run-pass tests with expected warnings should be moved to ui/"
405- ) ;
406-
407421 let proc_res = self . exec_compiled_test ( ) ;
408422 if !proc_res. status . success ( ) {
409423 self . fatal_proc_rec ( "test run failed!" , & proc_res) ;
@@ -2913,10 +2927,11 @@ impl<'test> TestCx<'test> {
29132927 fn run_incremental_test ( & self ) {
29142928 // Basic plan for a test incremental/foo/bar.rs:
29152929 // - load list of revisions rpass1, cfail2, rpass3
2916- // - each should begin with `rpass`, `cfail`, or `rfail`
2917- // - if `rpass`, expect compile and execution to succeed
2930+ // - each should begin with `cpass`, `rpass`, `cfail`, or `rfail`
2931+ // - if `cpass`, expect compilation to succeed, don't execute
2932+ // - if `rpass`, expect compilation and execution to succeed
29182933 // - if `cfail`, expect compilation to fail
2919- // - if `rfail`, expect execution to fail
2934+ // - if `rfail`, expect compilation to succeed and execution to fail
29202935 // - create a directory build/foo/bar.incremental
29212936 // - compile foo/bar.rs with -C incremental=.../foo/bar.incremental and -C rpass1
29222937 // - because name of revision starts with "rpass", expect success
@@ -2940,7 +2955,12 @@ impl<'test> TestCx<'test> {
29402955 print ! ( "revision={:?} props={:#?}" , revision, self . props) ;
29412956 }
29422957
2943- if revision. starts_with ( "rpass" ) {
2958+ if revision. starts_with ( "cpass" ) {
2959+ if self . props . should_ice {
2960+ self . fatal ( "can only use should-ice in cfail tests" ) ;
2961+ }
2962+ self . run_cpass_test ( ) ;
2963+ } else if revision. starts_with ( "rpass" ) {
29442964 if self . props . should_ice {
29452965 self . fatal ( "can only use should-ice in cfail tests" ) ;
29462966 }
@@ -2953,7 +2973,7 @@ impl<'test> TestCx<'test> {
29532973 } else if revision. starts_with ( "cfail" ) {
29542974 self . run_cfail_test ( ) ;
29552975 } else {
2956- self . fatal ( "revision name must begin with rpass, rfail, or cfail" ) ;
2976+ self . fatal ( "revision name must begin with cpass, rpass, rfail, or cfail" ) ;
29572977 }
29582978 }
29592979
0 commit comments