Parse the contents of `path` looking for directive-based comments starting with `;;!` near the top of the file.
(path: &Path)
| 170 | /// Parse the contents of `path` looking for directive-based comments |
| 171 | /// starting with `;;!` near the top of the file. |
| 172 | fn new(path: &Path) -> Result<Test> { |
| 173 | let contents = |
| 174 | std::fs::read_to_string(path).with_context(|| format!("failed to read {path:?}"))?; |
| 175 | let config: TestConfig = wasmtime_test_util::wast::parse_test_config(&contents, ";;!") |
| 176 | .context("failed to parse test configuration as TOML")?; |
| 177 | let mut flags = vec!["wasmtime"]; |
| 178 | if let Some(config) = &config.flags { |
| 179 | flags.extend(config.to_vec()); |
| 180 | } |
| 181 | let mut opts = wasmtime_cli_flags::CommonOptions::try_parse_from(&flags)?; |
| 182 | opts.codegen.cranelift_debug_verifier = Some(true); |
| 183 | |
| 184 | Ok(Test { |
| 185 | path: path.to_path_buf(), |
| 186 | config, |
| 187 | opts, |
| 188 | contents, |
| 189 | }) |
| 190 | } |
| 191 | |
| 192 | /// Generates CLIF for all the wasm functions in this test. |
| 193 | fn compile(&mut self) -> Result<CompileOutput> { |
nothing calls this directly
no test coverage detected