diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 4be658e86cb..30727226427 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -47,7 +47,8 @@ fn run_tests(mode: Mode, path: &str, target: Option) { (true, true) => panic!("cannot use MIRI_BLESS and MIRI_SKIP_UI_CHECKS at the same time"), }; - let path_filter = std::env::args().skip(1).next(); + // Pass on all arguments as filters. + let path_filter = std::env::args().skip(1); let config = Config { args: flags, @@ -56,7 +57,7 @@ fn run_tests(mode: Mode, path: &str, target: Option) { stdout_filters: STDOUT.clone(), root_dir: PathBuf::from(path), mode, - path_filter, + path_filter: path_filter.collect(), program: miri_path(), output_conflict_handling, }; diff --git a/ui_test/src/lib.rs b/ui_test/src/lib.rs index 81560db6dff..866a9fe46ac 100644 --- a/ui_test/src/lib.rs +++ b/ui_test/src/lib.rs @@ -30,8 +30,8 @@ pub struct Config { pub mode: Mode, pub program: PathBuf, pub output_conflict_handling: OutputConflictHandling, - /// Only run tests with this string in their path/name - pub path_filter: Option, + /// Only run tests with one of these strings in their path/name + pub path_filter: Vec, } #[derive(Debug)] @@ -77,12 +77,13 @@ pub fn run_tests(config: Config) { if !path.extension().map(|ext| ext == "rs").unwrap_or(false) { continue; } - if let Some(path_filter) = &config.path_filter { - if !path.display().to_string().contains(path_filter) { + if !config.path_filter.is_empty() { + let path_display = path.display().to_string(); + if !config.path_filter.iter().any(|filter| path_display.contains(filter)) { ignored.fetch_add(1, Ordering::Relaxed); eprintln!( "{} .. {}", - path.display(), + path_display, "ignored (command line filter)".yellow() ); continue; diff --git a/ui_test/src/tests.rs b/ui_test/src/tests.rs index 5485e6b4f26..b2544e68ada 100644 --- a/ui_test/src/tests.rs +++ b/ui_test/src/tests.rs @@ -10,7 +10,7 @@ fn config() -> Config { stdout_filters: vec![], root_dir: PathBuf::from("."), mode: Mode::Fail, - path_filter: None, + path_filter: vec![], program: PathBuf::from("cake"), output_conflict_handling: OutputConflictHandling::Error, }