@@ -9,7 +9,7 @@ use camino::{Utf8Path, Utf8PathBuf};
9
9
use semver:: Version ;
10
10
use tracing:: * ;
11
11
12
- use crate :: common:: { Config , Debugger , FailMode , Mode , PassMode } ;
12
+ use crate :: common:: { Config , Debugger , FailMode , PassMode , TestMode } ;
13
13
use crate :: debuggers:: { extract_cdb_version, extract_gdb_version} ;
14
14
use crate :: directives:: auxiliary:: { AuxProps , parse_and_update_aux} ;
15
15
use crate :: directives:: needs:: CachedNeedsConditions ;
@@ -328,7 +328,7 @@ impl TestProps {
328
328
props. exec_env . push ( ( "RUSTC" . to_string ( ) , config. rustc_path . to_string ( ) ) ) ;
329
329
330
330
match ( props. pass_mode , props. fail_mode ) {
331
- ( None , None ) if config. mode == Mode :: Ui => props. fail_mode = Some ( FailMode :: Check ) ,
331
+ ( None , None ) if config. mode == TestMode :: Ui => props. fail_mode = Some ( FailMode :: Check ) ,
332
332
( Some ( _) , Some ( _) ) => panic ! ( "cannot use a *-fail and *-pass mode together" ) ,
333
333
_ => { }
334
334
}
@@ -609,11 +609,11 @@ impl TestProps {
609
609
self . failure_status = Some ( 101 ) ;
610
610
}
611
611
612
- if config. mode == Mode :: Incremental {
612
+ if config. mode == TestMode :: Incremental {
613
613
self . incremental = true ;
614
614
}
615
615
616
- if config. mode == Mode :: Crashes {
616
+ if config. mode == TestMode :: Crashes {
617
617
// we don't want to pollute anything with backtrace-files
618
618
// also turn off backtraces in order to save some execution
619
619
// time on the tests; we only need to know IF it crashes
@@ -641,11 +641,11 @@ impl TestProps {
641
641
fn update_fail_mode ( & mut self , ln : & str , config : & Config ) {
642
642
let check_ui = |mode : & str | {
643
643
// Mode::Crashes may need build-fail in order to trigger llvm errors or stack overflows
644
- if config. mode != Mode :: Ui && config. mode != Mode :: Crashes {
644
+ if config. mode != TestMode :: Ui && config. mode != TestMode :: Crashes {
645
645
panic ! ( "`{}-fail` directive is only supported in UI tests" , mode) ;
646
646
}
647
647
} ;
648
- if config. mode == Mode :: Ui && config. parse_name_directive ( ln, "compile-fail" ) {
648
+ if config. mode == TestMode :: Ui && config. parse_name_directive ( ln, "compile-fail" ) {
649
649
panic ! ( "`compile-fail` directive is useless in UI tests" ) ;
650
650
}
651
651
let fail_mode = if config. parse_name_directive ( ln, "check-fail" ) {
@@ -669,10 +669,10 @@ impl TestProps {
669
669
670
670
fn update_pass_mode ( & mut self , ln : & str , revision : Option < & str > , config : & Config ) {
671
671
let check_no_run = |s| match ( config. mode , s) {
672
- ( Mode :: Ui , _) => ( ) ,
673
- ( Mode :: Crashes , _) => ( ) ,
674
- ( Mode :: Codegen , "build-pass" ) => ( ) ,
675
- ( Mode :: Incremental , _) => {
672
+ ( TestMode :: Ui , _) => ( ) ,
673
+ ( TestMode :: Crashes , _) => ( ) ,
674
+ ( TestMode :: Codegen , "build-pass" ) => ( ) ,
675
+ ( TestMode :: Incremental , _) => {
676
676
if revision. is_some ( ) && !self . revisions . iter ( ) . all ( |r| r. starts_with ( "cfail" ) ) {
677
677
panic ! ( "`{s}` directive is only supported in `cfail` incremental tests" )
678
678
}
@@ -715,7 +715,7 @@ impl TestProps {
715
715
pub fn update_add_core_stubs ( & mut self , ln : & str , config : & Config ) {
716
716
let add_core_stubs = config. parse_name_directive ( ln, directives:: ADD_CORE_STUBS ) ;
717
717
if add_core_stubs {
718
- if !matches ! ( config. mode, Mode :: Ui | Mode :: Codegen | Mode :: Assembly ) {
718
+ if !matches ! ( config. mode, TestMode :: Ui | TestMode :: Codegen | TestMode :: Assembly ) {
719
719
panic ! (
720
720
"`add-core-stubs` is currently only supported for ui, codegen and assembly test modes"
721
721
) ;
@@ -833,7 +833,7 @@ pub(crate) struct CheckDirectiveResult<'ln> {
833
833
834
834
pub ( crate ) fn check_directive < ' a > (
835
835
directive_ln : & ' a str ,
836
- mode : Mode ,
836
+ mode : TestMode ,
837
837
original_line : & str ,
838
838
) -> CheckDirectiveResult < ' a > {
839
839
let ( directive_name, post) = directive_ln. split_once ( [ ':' , ' ' ] ) . unwrap_or ( ( directive_ln, "" ) ) ;
@@ -842,11 +842,11 @@ pub(crate) fn check_directive<'a>(
842
842
let is_known = |s : & str | {
843
843
KNOWN_DIRECTIVE_NAMES . contains ( & s)
844
844
|| match mode {
845
- Mode :: Rustdoc | Mode :: RustdocJson => {
845
+ TestMode :: Rustdoc | TestMode :: RustdocJson => {
846
846
original_line. starts_with ( "//@" )
847
847
&& match mode {
848
- Mode :: Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES ,
849
- Mode :: RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES ,
848
+ TestMode :: Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES ,
849
+ TestMode :: RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES ,
850
850
_ => unreachable ! ( ) ,
851
851
}
852
852
. contains ( & s)
@@ -868,7 +868,7 @@ pub(crate) fn check_directive<'a>(
868
868
const COMPILETEST_DIRECTIVE_PREFIX : & str = "//@" ;
869
869
870
870
fn iter_directives (
871
- mode : Mode ,
871
+ mode : TestMode ,
872
872
_suite : & str ,
873
873
poisoned : & mut bool ,
874
874
testfile : & Utf8Path ,
@@ -883,7 +883,7 @@ fn iter_directives(
883
883
// specify them manually in every test file.
884
884
//
885
885
// FIXME(jieyouxu): I feel like there's a better way to do this, leaving for later.
886
- if mode == Mode :: CoverageRun {
886
+ if mode == TestMode :: CoverageRun {
887
887
let extra_directives: & [ & str ] = & [
888
888
"needs-profiler-runtime" ,
889
889
// FIXME(pietroalbini): this test currently does not work on cross-compiled targets
@@ -964,7 +964,7 @@ impl Config {
964
964
[ "CHECK" , "COM" , "NEXT" , "SAME" , "EMPTY" , "NOT" , "COUNT" , "DAG" , "LABEL" ] ;
965
965
966
966
if let Some ( raw) = self . parse_name_value_directive ( line, "revisions" ) {
967
- if self . mode == Mode :: RunMake {
967
+ if self . mode == TestMode :: RunMake {
968
968
panic ! ( "`run-make` tests do not support revisions: {}" , testfile) ;
969
969
}
970
970
@@ -981,7 +981,7 @@ impl Config {
981
981
) ;
982
982
}
983
983
984
- if matches ! ( self . mode, Mode :: Assembly | Mode :: Codegen | Mode :: MirOpt )
984
+ if matches ! ( self . mode, TestMode :: Assembly | TestMode :: Codegen | TestMode :: MirOpt )
985
985
&& FILECHECK_FORBIDDEN_REVISION_NAMES . contains ( & revision)
986
986
{
987
987
panic ! (
0 commit comments