@@ -278,13 +278,15 @@ impl<'test> TestCx<'test> {
278
278
Incremental => {
279
279
let revision =
280
280
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
+ {
282
285
true
283
286
} else if revision. starts_with ( "cfail" ) {
284
- // FIXME: would be nice if incremental revs could start with "cpass"
285
287
pm. is_some ( )
286
288
} else {
287
- panic ! ( "revision name must begin with rpass, rfail, or cfail" ) ;
289
+ panic ! ( "revision name must begin with cpass, rpass, rfail, or cfail" ) ;
288
290
}
289
291
}
290
292
mode => panic ! ( "unimplemented for mode {:?}" , mode) ,
@@ -384,6 +386,20 @@ impl<'test> TestCx<'test> {
384
386
}
385
387
}
386
388
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
+
387
403
fn run_rpass_test ( & self ) {
388
404
let emit_metadata = self . should_emit_metadata ( self . pass_mode ( ) ) ;
389
405
let should_run = self . run_if_enabled ( ) ;
@@ -393,17 +409,15 @@ impl<'test> TestCx<'test> {
393
409
self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
394
410
}
395
411
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
+
396
417
if let WillExecute :: Disabled = should_run {
397
418
return ;
398
419
}
399
420
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
-
407
421
let proc_res = self . exec_compiled_test ( ) ;
408
422
if !proc_res. status . success ( ) {
409
423
self . fatal_proc_rec ( "test run failed!" , & proc_res) ;
@@ -2913,10 +2927,11 @@ impl<'test> TestCx<'test> {
2913
2927
fn run_incremental_test ( & self ) {
2914
2928
// Basic plan for a test incremental/foo/bar.rs:
2915
2929
// - 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
2918
2933
// - if `cfail`, expect compilation to fail
2919
- // - if `rfail`, expect execution to fail
2934
+ // - if `rfail`, expect compilation to succeed and execution to fail
2920
2935
// - create a directory build/foo/bar.incremental
2921
2936
// - compile foo/bar.rs with -C incremental=.../foo/bar.incremental and -C rpass1
2922
2937
// - because name of revision starts with "rpass", expect success
@@ -2940,7 +2955,12 @@ impl<'test> TestCx<'test> {
2940
2955
print ! ( "revision={:?} props={:#?}" , revision, self . props) ;
2941
2956
}
2942
2957
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" ) {
2944
2964
if self . props . should_ice {
2945
2965
self . fatal ( "can only use should-ice in cfail tests" ) ;
2946
2966
}
@@ -2953,7 +2973,7 @@ impl<'test> TestCx<'test> {
2953
2973
} else if revision. starts_with ( "cfail" ) {
2954
2974
self . run_cfail_test ( ) ;
2955
2975
} 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" ) ;
2957
2977
}
2958
2978
}
2959
2979
0 commit comments