| 93 | } |
| 94 | |
| 95 | fn find_tests(path: &Path, dst: &mut Vec<PathBuf>) -> Result<()> { |
| 96 | for file in path |
| 97 | .read_dir() |
| 98 | .with_context(|| format!("failed to read {path:?}"))? |
| 99 | { |
| 100 | let file = file.context("failed to read directory entry")?; |
| 101 | let path = file.path(); |
| 102 | if file.file_type()?.is_dir() { |
| 103 | find_tests(&path, dst)?; |
| 104 | } else if path.extension().and_then(|s| s.to_str()) == Some("wat") { |
| 105 | dst.push(path); |
| 106 | } |
| 107 | } |
| 108 | Ok(()) |
| 109 | } |
| 110 | |
| 111 | fn run_test(path: &Path) -> Result<()> { |
| 112 | let mut test = Test::new(path)?; |