Rollup merge of #81356 - ehuss:libtest-filters, r=m-ou-se
libtest: allow multiple filters Libtest ignores any filters after the first. This changes it so that if multiple filters are passed, it will test against all of them. This also affects compiletest to do the same. Closes #30422
This commit is contained in:
commit
b102ea479d
7 changed files with 65 additions and 29 deletions
|
|
@ -240,8 +240,8 @@ pub struct Config {
|
|||
/// Run ignored tests
|
||||
pub run_ignored: bool,
|
||||
|
||||
/// Only run tests that match this filter
|
||||
pub filter: Option<String>,
|
||||
/// Only run tests that match these filters
|
||||
pub filters: Vec<String>,
|
||||
|
||||
/// Exactly match the filter, rather than a substring
|
||||
pub filter_exact: bool,
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
|||
suite: matches.opt_str("suite").unwrap(),
|
||||
debugger: None,
|
||||
run_ignored,
|
||||
filter: matches.free.first().cloned(),
|
||||
filters: matches.free.clone(),
|
||||
filter_exact: matches.opt_present("exact"),
|
||||
force_pass_mode: matches.opt_str("pass").map(|mode| {
|
||||
mode.parse::<PassMode>()
|
||||
|
|
@ -280,7 +280,7 @@ pub fn log_config(config: &Config) {
|
|||
logv(c, format!("stage_id: {}", config.stage_id));
|
||||
logv(c, format!("mode: {}", config.mode));
|
||||
logv(c, format!("run_ignored: {}", config.run_ignored));
|
||||
logv(c, format!("filter: {}", opt_str(&config.filter)));
|
||||
logv(c, format!("filters: {:?}", config.filters));
|
||||
logv(c, format!("filter_exact: {}", config.filter_exact));
|
||||
logv(
|
||||
c,
|
||||
|
|
@ -465,7 +465,7 @@ fn configure_lldb(config: &Config) -> Option<Config> {
|
|||
pub fn test_opts(config: &Config) -> test::TestOpts {
|
||||
test::TestOpts {
|
||||
exclude_should_panic: false,
|
||||
filter: config.filter.clone(),
|
||||
filters: config.filters.clone(),
|
||||
filter_exact: config.filter_exact,
|
||||
run_ignored: if config.run_ignored { test::RunIgnored::Yes } else { test::RunIgnored::No },
|
||||
format: if config.quiet { test::OutputFormat::Terse } else { test::OutputFormat::Pretty },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue