@@ -99,6 +99,33 @@ impl fmt::Display for Mode {
99
99
}
100
100
}
101
101
102
+ /// Mode with extra forms.
103
+ /// Used for `--filter-mode` to allow `compile-pass` to be used.
104
+ #[ derive( Clone , Copy , PartialEq , Debug ) ]
105
+ pub enum ExtraMode {
106
+ Mode ( Mode ) ,
107
+ CompilePass ,
108
+ }
109
+
110
+ impl FromStr for ExtraMode {
111
+ type Err = ( ) ;
112
+ fn from_str ( s : & str ) -> Result < Self , ( ) > {
113
+ match s {
114
+ "compile-pass" => Ok ( ExtraMode :: CompilePass ) ,
115
+ s => Mode :: from_str ( s) . map ( ExtraMode :: Mode ) ,
116
+ }
117
+ }
118
+ }
119
+
120
+ impl fmt:: Display for ExtraMode {
121
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
122
+ match * self {
123
+ ExtraMode :: CompilePass => fmt:: Display :: fmt ( "compile-pass" , f) ,
124
+ ExtraMode :: Mode ( mode) => mode. fmt ( f) ,
125
+ }
126
+ }
127
+ }
128
+
102
129
#[ derive( Clone , Debug , PartialEq ) ]
103
130
pub enum CompareMode {
104
131
Nll ,
@@ -184,6 +211,9 @@ pub struct Config {
184
211
/// Exactly match the filter, rather than a substring
185
212
pub filter_exact : bool ,
186
213
214
+ /// Only run tests that match any of these modes.
215
+ pub filter_mode : Option < Vec < ExtraMode > > ,
216
+
187
217
/// Write out a parseable log of tests that were run
188
218
pub logfile : Option < PathBuf > ,
189
219
0 commit comments