mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
refactor(xtask/cts): move TEST_LINE_REGEX to single site of use
This commit is contained in:
parent
5e6c151f9f
commit
5cbab61109
@ -50,12 +50,6 @@ const CTS_GIT_URL: &str = "https://github.com/gpuweb/cts.git";
|
|||||||
/// Path to default CTS test list.
|
/// Path to default CTS test list.
|
||||||
const CTS_DEFAULT_TEST_LIST: &str = "cts_runner/test.lst";
|
const CTS_DEFAULT_TEST_LIST: &str = "cts_runner/test.lst";
|
||||||
|
|
||||||
static TEST_LINE_REGEX: LazyLock<Regex> = LazyLock::new(|| {
|
|
||||||
RegexBuilder::new(r#"(?:fails-if\s*\(\s*(?<fails_if>\w+)\s*\)\s+)?(?<selector>.*)"#)
|
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
});
|
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct TestLine {
|
struct TestLine {
|
||||||
pub selector: OsString,
|
pub selector: OsString,
|
||||||
@ -103,6 +97,12 @@ pub fn run_cts(
|
|||||||
|
|
||||||
for file in list_files {
|
for file in list_files {
|
||||||
tests.extend(shell.read_file(file)?.lines().filter_map(|line| {
|
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()
|
||||||
|
});
|
||||||
|
|
||||||
let trimmed = line.trim();
|
let trimmed = line.trim();
|
||||||
let is_comment = trimmed.starts_with("//") || trimmed.starts_with("#");
|
let is_comment = trimmed.starts_with("//") || trimmed.starts_with("#");
|
||||||
let captures = TEST_LINE_REGEX
|
let captures = TEST_LINE_REGEX
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user