Skip to content

Commit

Permalink
WPT: Include .htm files. Stop filtering out tentative tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Nov 7, 2024
1 parent e42bd8e commit d02253d
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions apps/wpt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,29 @@ fn collect_tests(wpt_dir: &Path) -> Vec<PathBuf> {
}

for suite in suites {
let pattern = format!("{}/{}/**/*.html", wpt_dir.display(), suite);

let glob_results = glob::glob(&pattern).expect("Invalid glob pattern.");

test_paths.extend(glob_results.filter_map(|glob_result| {
if let Ok(path_buf) = glob_result {
let is_tentative = path_buf.ends_with("tentative.html");
let is_ref = path_buf.to_string_lossy().ends_with("-ref.html")
|| path_contains_directory(&path_buf, "reference");
let is_support_file = path_contains_directory(&path_buf, "support");

if !is_tentative && !is_ref && !is_support_file {
Some(path_buf)
for ext in ["htm", "html" /*, "xht", "xhtml"*/] {
let pattern = format!("{}/{}/**/*.{}", wpt_dir.display(), suite, ext);

let glob_results = glob::glob(&pattern).expect("Invalid glob pattern.");

test_paths.extend(glob_results.filter_map(|glob_result| {
if let Ok(path_buf) = glob_result {
// let is_tentative = path_buf.ends_with("tentative.html");
let is_ref = path_buf.to_string_lossy().ends_with("-ref.html")
|| path_contains_directory(&path_buf, "reference");
let is_support_file = path_contains_directory(&path_buf, "support");

if !is_ref && !is_support_file {
Some(path_buf)
} else {
None
}
} else {
None
error!("Failure during glob.");
panic!("Failure during glob");
}
} else {
error!("Failure during glob.");
panic!("Failure during glob");
}
}));
}));
}
}

test_paths
Expand Down

0 comments on commit d02253d

Please sign in to comment.