MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / compile

Method compile

crates/test/src/wat.rs:32–43  ·  view source on GitHub ↗
(&self, runner: &Runner, compile: &Compile<'_>)

Source from the content-addressed store, hash-verified

30 }
31
32 fn compile(&self, runner: &Runner, compile: &Compile<'_>) -> Result<()> {
33 let wasm = wat::parse_file(&compile.component.path)?;
34 if wasmparser::Parser::is_component(&wasm) {
35 super::write_if_different(&compile.output, wasm)?;
36 return Ok(());
37 }
38
39 let p1 = compile.output.with_extension("core.wasm");
40 super::write_if_different(&p1, wasm)?;
41 runner.convert_p1_to_component(&p1, compile)?;
42 Ok(())
43 }
44
45 fn verify(&self, _runner: &Runner, _verify: &Verify<'_>) -> Result<()> {
46 // doesn't participate in codegen tests

Callers

nothing calls this directly

Calls 2

write_if_differentFunction · 0.85

Tested by

no test coverage detected