Skip to content

Commit

Permalink
Mark tests that fail and use calc
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Dec 4, 2024
1 parent 56db12f commit 838d376
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions apps/wpt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ bitflags! {
pub struct TestFlags : u32 {
const USES_FLOAT = 0b00000001;
const USES_INTRINSIC_SIZE = 0b00000010;
const USES_DIRECTION = 0b00000100;
const USES_WRITING_MODE = 0b00001000;
const USES_CALC = 0b00000100;
const USES_DIRECTION = 0b00001000;
const USES_WRITING_MODE = 0b00010000;
}
}

Expand Down Expand Up @@ -175,6 +176,7 @@ struct ThreadCtx {
attrtest_re: Regex,
float_re: Regex,
intrinsic_re: Regex,
calc_re: Regex,
direction_re: Regex,
writing_mode_re: Regex,
out_dir: PathBuf,
Expand Down Expand Up @@ -222,6 +224,9 @@ impl TestResult {
if self.flags.contains(TestFlags::USES_INTRINSIC_SIZE) {
write!(out, "{}", "I".bright_black()).unwrap();
}
if self.flags.contains(TestFlags::USES_CALC) {
write!(out, "{}", "C".bright_black()).unwrap();
}
if self.flags.contains(TestFlags::USES_DIRECTION) {
write!(out, "{}", "D".bright_black()).unwrap();
}
Expand Down Expand Up @@ -300,6 +305,7 @@ fn main() {
let float_re = Regex::new(r#"float:"#).unwrap();
let intrinsic_re =
Regex::new(r#"(width|height): ?(min|max|fit)-content"#).unwrap();
let calc_re = Regex::new(r#"calc\("#).unwrap();
let direction_re = Regex::new(r#"direction:"#).unwrap();
let writing_mode_re = Regex::new(r#"writing-mode:"#).unwrap();

Expand All @@ -323,6 +329,7 @@ fn main() {
attrtest_re,
float_re,
intrinsic_re,
calc_re,
direction_re,
writing_mode_re,
out_dir: out_dir.clone(),
Expand Down Expand Up @@ -439,6 +446,9 @@ async fn process_test_file(
if ctx.intrinsic_re.is_match(&file_contents) {
flags |= TestFlags::USES_INTRINSIC_SIZE;
}
if ctx.calc_re.is_match(&file_contents) {
flags |= TestFlags::USES_CALC;
}
if ctx.direction_re.is_match(&file_contents) {
flags |= TestFlags::USES_DIRECTION;
}
Expand Down

0 comments on commit 838d376

Please sign in to comment.