@@ -290,6 +290,13 @@ impl EarlyProps {
290290 }
291291}
292292
293+ #[ derive( Clone , Copy , PartialEq , Debug ) ]
294+ pub enum PassMode {
295+ Check ,
296+ Build ,
297+ Run ,
298+ }
299+
293300#[ derive( Clone , Debug ) ]
294301pub struct TestProps {
295302 // Lines that should be expected, in order, on standard out
@@ -349,14 +356,10 @@ pub struct TestProps {
349356 // testing harness and used when generating compilation
350357 // arguments. (In particular, it propagates to the aux-builds.)
351358 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 > ,
354361 // rustdoc will test the output of the `--test` option
355362 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 ,
360363 // Do not pass `-Z ui-testing` to UI tests
361364 pub disable_ui_testing_normalization : bool ,
362365 // customized normalization rules
@@ -396,10 +399,8 @@ impl TestProps {
396399 pretty_compare_only : false ,
397400 forbid_output : vec ! [ ] ,
398401 incremental_dir : None ,
399- compile_pass : false ,
402+ pass_mode : None ,
400403 check_test_line_numbers_match : false ,
401- run_pass : false ,
402- skip_codegen : false ,
403404 disable_ui_testing_normalization : false ,
404405 normalize_stdout : vec ! [ ] ,
405406 normalize_stderr : vec ! [ ] ,
@@ -525,17 +526,14 @@ impl TestProps {
525526 self . check_test_line_numbers_match = config. parse_check_test_line_numbers_match ( ln) ;
526527 }
527528
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 ) ;
539537 }
540538
541539 if !self . disable_ui_testing_normalization {
@@ -710,10 +708,6 @@ impl Config {
710708 }
711709 }
712710
713- fn parse_compile_pass ( & self , line : & str ) -> bool {
714- self . parse_name_directive ( line, "compile-pass" )
715- }
716-
717711 fn parse_disable_ui_testing_normalization ( & self , line : & str ) -> bool {
718712 self . parse_name_directive ( line, "disable-ui-testing-normalization" )
719713 }
@@ -722,14 +716,6 @@ impl Config {
722716 self . parse_name_directive ( line, "check-test-line-numbers-match" )
723717 }
724718
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-
733719 fn parse_assembly_output ( & self , line : & str ) -> Option < String > {
734720 self . parse_name_value_directive ( line, "assembly-output" )
735721 . map ( |r| r. trim ( ) . to_string ( ) )
0 commit comments