diff --git a/xtask/src/cts.rs b/xtask/src/cts.rs index 18367300b..e23952fcd 100644 --- a/xtask/src/cts.rs +++ b/xtask/src/cts.rs @@ -53,7 +53,7 @@ const CTS_DEFAULT_TEST_LIST: &str = "cts_runner/test.lst"; #[derive(Default)] struct TestLine { pub selector: OsString, - pub fails_if: Option, + pub fails_if: Vec, } pub fn run_cts( @@ -98,9 +98,11 @@ pub fn run_cts( for file in list_files { tests.extend(shell.read_file(file)?.lines().filter_map(|line| { static TEST_LINE_REGEX: LazyLock = LazyLock::new(|| { - RegexBuilder::new(r#"(?:fails-if\s*\(\s*(?\w+)\s*\)\s+)?(?.*)"#) - .build() - .unwrap() + RegexBuilder::new( + r#"(?:fails-if\s*\(\s*(?\w+(?:,\w+)*?)\s*\)\s+)?(?.*)"#, + ) + .build() + .unwrap() }); let trimmed = line.trim(); @@ -110,7 +112,15 @@ pub fn run_cts( .expect("Invalid test line: {trimmed}"); (!trimmed.is_empty() && !is_comment).then(|| TestLine { selector: OsString::from(&captures["selector"]), - fails_if: captures.name("fails_if").map(|m| m.as_str().to_string()), + fails_if: captures + .name("fails_if") + .map(|m| { + m.as_str() + .split_terminator(',') + .map(|m| m.to_string()) + .collect() + }) + .unwrap_or_default(), }) })) } @@ -237,8 +247,8 @@ pub fn run_cts( log::info!("Running CTS"); for test in &tests { - match (&test.fails_if, &running_on_backend) { - (Some(backend), Some(running_on_backend)) if backend == running_on_backend => { + if let Some(running_on_backend) = &running_on_backend { + if test.fails_if.contains(running_on_backend) { log::info!( "Skipping {} on {} backend", test.selector.to_string_lossy(), @@ -246,7 +256,6 @@ pub fn run_cts( ); continue; } - _ => {} } log::info!("Running {}", test.selector.to_string_lossy());