@@ -290,6 +290,13 @@ impl EarlyProps {
290
290
}
291
291
}
292
292
293
+ #[ derive( Clone , Copy , PartialEq , Debug ) ]
294
+ pub enum PassMode {
295
+ Check ,
296
+ Build ,
297
+ Run ,
298
+ }
299
+
293
300
#[ derive( Clone , Debug ) ]
294
301
pub struct TestProps {
295
302
// Lines that should be expected, in order, on standard out
@@ -349,14 +356,10 @@ pub struct TestProps {
349
356
// testing harness and used when generating compilation
350
357
// arguments. (In particular, it propagates to the aux-builds.)
351
358
pub incremental_dir : Option < PathBuf > ,
352
- // Specifies that a test must actually compile without errors .
353
- pub compile_pass : bool ,
359
+ // How far should the test proceed while still passing .
360
+ pub pass_mode : Option < PassMode > ,
354
361
// rustdoc will test the output of the `--test` option
355
362
pub check_test_line_numbers_match : bool ,
356
- // The test must be compiled and run successfully. Only used in UI tests for now.
357
- pub run_pass : bool ,
358
- // Skip any codegen step and running the executable. Only for run-pass.
359
- pub skip_codegen : bool ,
360
363
// Do not pass `-Z ui-testing` to UI tests
361
364
pub disable_ui_testing_normalization : bool ,
362
365
// customized normalization rules
@@ -396,10 +399,8 @@ impl TestProps {
396
399
pretty_compare_only : false ,
397
400
forbid_output : vec ! [ ] ,
398
401
incremental_dir : None ,
399
- compile_pass : false ,
402
+ pass_mode : None ,
400
403
check_test_line_numbers_match : false ,
401
- run_pass : false ,
402
- skip_codegen : false ,
403
404
disable_ui_testing_normalization : false ,
404
405
normalize_stdout : vec ! [ ] ,
405
406
normalize_stderr : vec ! [ ] ,
@@ -525,17 +526,14 @@ impl TestProps {
525
526
self . check_test_line_numbers_match = config. parse_check_test_line_numbers_match ( ln) ;
526
527
}
527
528
528
- if !self . run_pass {
529
- self . run_pass = config. parse_run_pass ( ln) ;
530
- }
531
-
532
- if !self . compile_pass {
533
- // run-pass implies compile_pass
534
- self . compile_pass = config. parse_compile_pass ( ln) || self . run_pass ;
535
- }
536
-
537
- if !self . skip_codegen {
538
- self . skip_codegen = config. parse_skip_codegen ( ln) ;
529
+ if config. parse_name_directive ( ln, "check-pass" ) ||
530
+ config. parse_name_directive ( ln, "skip-codegen" ) {
531
+ self . pass_mode = Some ( PassMode :: Check ) ;
532
+ } else if config. parse_name_directive ( ln, "build-pass" ) ||
533
+ config. parse_name_directive ( ln, "compile-pass" ) {
534
+ self . pass_mode = Some ( PassMode :: Build ) ;
535
+ } else if config. parse_name_directive ( ln, "run-pass" ) {
536
+ self . pass_mode = Some ( PassMode :: Run ) ;
539
537
}
540
538
541
539
if !self . disable_ui_testing_normalization {
@@ -710,10 +708,6 @@ impl Config {
710
708
}
711
709
}
712
710
713
- fn parse_compile_pass ( & self , line : & str ) -> bool {
714
- self . parse_name_directive ( line, "compile-pass" )
715
- }
716
-
717
711
fn parse_disable_ui_testing_normalization ( & self , line : & str ) -> bool {
718
712
self . parse_name_directive ( line, "disable-ui-testing-normalization" )
719
713
}
@@ -722,14 +716,6 @@ impl Config {
722
716
self . parse_name_directive ( line, "check-test-line-numbers-match" )
723
717
}
724
718
725
- fn parse_run_pass ( & self , line : & str ) -> bool {
726
- self . parse_name_directive ( line, "run-pass" )
727
- }
728
-
729
- fn parse_skip_codegen ( & self , line : & str ) -> bool {
730
- self . parse_name_directive ( line, "skip-codegen" )
731
- }
732
-
733
719
fn parse_assembly_output ( & self , line : & str ) -> Option < String > {
734
720
self . parse_name_value_directive ( line, "assembly-output" )
735
721
. map ( |r| r. trim ( ) . to_string ( ) )
0 commit comments