MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / find_tests

Function find_tests

tests/disas.rs:95–109  ·  view source on GitHub ↗
(path: &Path, dst: &mut Vec<PathBuf>)

Source from the content-addressed store, hash-verified

93}
94
95fn 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
111fn run_test(path: &Path) -> Result<()> {
112 let mut test = Test::new(path)?;

Callers 1

mainFunction · 0.70

Calls 7

OkFunction · 0.85
with_contextMethod · 0.80
is_dirMethod · 0.80
to_strMethod · 0.80
contextMethod · 0.45
pathMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected