mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
test(cts): allow comma-separated backend list in fails-if(…)
This commit is contained in:
parent
5cbab61109
commit
83a0722eb6
@ -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<String>,
|
||||
pub fails_if: Vec<String>,
|
||||
}
|
||||
|
||||
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<Regex> = LazyLock::new(|| {
|
||||
RegexBuilder::new(r#"(?:fails-if\s*\(\s*(?<fails_if>\w+)\s*\)\s+)?(?<selector>.*)"#)
|
||||
.build()
|
||||
.unwrap()
|
||||
RegexBuilder::new(
|
||||
r#"(?:fails-if\s*\(\s*(?<fails_if>\w+(?:,\w+)*?)\s*\)\s+)?(?<selector>.*)"#,
|
||||
)
|
||||
.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());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user