@@ -66,8 +66,8 @@ fn third_party_crates() -> String {
66
66
fn default_config ( ) -> compiletest:: Config {
67
67
let mut config = compiletest:: Config :: default ( ) ;
68
68
69
- if let Ok ( name ) = env:: var ( "TESTNAME" ) {
70
- config. filter = Some ( name ) ;
69
+ if let Ok ( filters ) = env:: var ( "TESTNAME" ) {
70
+ config. filters = filters . split ( ',' ) . map ( std :: string :: ToString :: to_string ) . collect ( ) ;
71
71
}
72
72
73
73
if let Some ( path) = option_env ! ( "RUSTC_LIB_PATH" ) {
@@ -167,7 +167,7 @@ fn run_ui_toml(config: &mut compiletest::Config) {
167
167
fn run_ui_cargo ( config : & mut compiletest:: Config ) {
168
168
fn run_tests (
169
169
config : & compiletest:: Config ,
170
- filter : & Option < String > ,
170
+ filters : & [ String ] ,
171
171
mut tests : Vec < tester:: TestDescAndFn > ,
172
172
) -> Result < bool , io:: Error > {
173
173
let mut result = true ;
@@ -181,9 +181,10 @@ fn run_ui_cargo(config: &mut compiletest::Config) {
181
181
182
182
// Use the filter if provided
183
183
let dir_path = dir. path ( ) ;
184
- match & filter {
185
- Some ( name) if !dir_path. ends_with ( name) => continue ,
186
- _ => { } ,
184
+ for filter in filters {
185
+ if !dir_path. ends_with ( filter) {
186
+ continue ;
187
+ }
187
188
}
188
189
189
190
for case in fs:: read_dir ( & dir_path) ? {
@@ -243,8 +244,7 @@ fn run_ui_cargo(config: &mut compiletest::Config) {
243
244
244
245
let current_dir = env:: current_dir ( ) . unwrap ( ) ;
245
246
let conf_dir = var ( "CLIPPY_CONF_DIR" ) . unwrap_or_default ( ) ;
246
- let filter = env:: var ( "TESTNAME" ) . ok ( ) ;
247
- let res = run_tests ( & config, & filter, tests) ;
247
+ let res = run_tests ( & config, & config. filters , tests) ;
248
248
env:: set_current_dir ( current_dir) . unwrap ( ) ;
249
249
set_var ( "CLIPPY_CONF_DIR" , conf_dir) ;
250
250
0 commit comments