diff --git a/apps/wpt/src/main.rs b/apps/wpt/src/main.rs index 1ce26363..b8506632 100644 --- a/apps/wpt/src/main.rs +++ b/apps/wpt/src/main.rs @@ -490,18 +490,18 @@ fn main() { println!("{fail_count:>4} tests FAILED ({fail_percent_run:.2}% of run; {fail_percent_total:.2}% of found)"); println!("{}", "\nOf those which failed:".bright_black()); + println!("{other_fail_count:>4} do not use unsupported features"); + println!("{writing_mode_fail_count:>4} use writing-mode"); + println!("{direction_fail_count:>4} use direction"); + println!("{float_fail_count:>4} use floats"); + println!("{intrinsic_size_fail_count:>4} use intrinsic size keywords"); + println!("{calc_fail_count:>4} use calc"); if subgrid_fail_count > 0 { println!("{subgrid_fail_count:>4} use subgrid"); } if masonry_fail_count > 0 { println!("{masonry_fail_count:>4} use masonry"); } - println!("{writing_mode_fail_count:>4} use writing_mode"); - println!("{direction_fail_count:>4} use direction"); - println!("{calc_fail_count:>4} use calc"); - println!("{intrinsic_size_fail_count:>4} use intrinsic size keywords"); - println!("{float_fail_count:>4} use floats"); - println!("{other_fail_count:>4} do not use unsupported features"); } #[allow(clippy::too_many_arguments)] @@ -548,6 +548,7 @@ async fn process_test_file( relative_path, file_contents.as_str(), reference.as_str(), + &mut flags, ) .await; diff --git a/apps/wpt/src/ref_test.rs b/apps/wpt/src/ref_test.rs index bdd800aa..8166a7bd 100644 --- a/apps/wpt/src/ref_test.rs +++ b/apps/wpt/src/ref_test.rs @@ -10,7 +10,7 @@ use std::io::Write; use std::path::Path; use std::sync::Arc; -use crate::{clone_font_ctx, BufferKind, TestStatus, ThreadCtx, HEIGHT, WIDTH}; +use crate::{clone_font_ctx, BufferKind, TestFlags, TestStatus, ThreadCtx, HEIGHT, WIDTH}; #[allow(clippy::too_many_arguments)] pub async fn process_ref_test( @@ -18,6 +18,7 @@ pub async fn process_ref_test( test_relative_path: &str, test_html: &str, ref_file: &str, + flags: &mut TestFlags, ) -> TestStatus { let ref_url: Url = ctx .dummy_base_url @@ -29,6 +30,28 @@ pub async fn process_ref_test( let ref_path = ctx.wpt_dir.join(&ref_relative_path); let ref_html = fs::read_to_string(ref_path).expect("Ref file not found."); + if ctx.float_re.is_match(&ref_html) { + *flags |= TestFlags::USES_FLOAT; + } + if ctx.intrinsic_re.is_match(&ref_html) { + *flags |= TestFlags::USES_INTRINSIC_SIZE; + } + if ctx.calc_re.is_match(&ref_html) { + *flags |= TestFlags::USES_CALC; + } + if ctx.direction_re.is_match(&ref_html) { + *flags |= TestFlags::USES_DIRECTION; + } + if ctx.writing_mode_re.is_match(&ref_html) { + *flags |= TestFlags::USES_WRITING_MODE; + } + if ctx.subgrid_re.is_match(&ref_html) { + *flags |= TestFlags::USES_SUBGRID; + } + if ctx.masonry_re.is_match(&ref_html) { + *flags |= TestFlags::USES_MASONRY; + } + let test_out_path = ctx .out_dir .join(format!("{}{}", test_relative_path, "-test.png"));