@@ -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 : Vec < 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,18 +244,19 @@ 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) ;
248
- env:: set_current_dir ( current_dir) . unwrap ( ) ;
249
- set_var ( "CLIPPY_CONF_DIR" , conf_dir) ;
250
-
251
- match res {
252
- Ok ( true ) => { } ,
253
- Ok ( false ) => panic ! ( "Some tests failed" ) ,
254
- Err ( e) => {
255
- panic ! ( "I/O failure during tests: {:?}" , e) ;
256
- } ,
257
- }
247
+ if let Some ( filter) = env:: var ( "TESTNAME" ) . ok ( ) {
248
+ let res = run_tests ( & config, vec ! [ filter] , tests) ;
249
+ env:: set_current_dir ( current_dir) . unwrap ( ) ;
250
+ set_var ( "CLIPPY_CONF_DIR" , conf_dir) ;
251
+
252
+ match res {
253
+ Ok ( true ) => { } ,
254
+ Ok ( false ) => panic ! ( "Some tests failed" ) ,
255
+ Err ( e) => {
256
+ panic ! ( "I/O failure during tests: {:?}" , e) ;
257
+ } ,
258
+ }
259
+ } ;
258
260
}
259
261
260
262
fn prepare_env ( ) {
0 commit comments