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

Function run_wasmtime_simple_wat

tests/all/cli_tests.rs:114–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112// Running simple wat
113#[test]
114fn run_wasmtime_simple_wat() -> Result<()> {
115 let wasm = build_wasm("tests/all/cli_tests/simple.wat")?;
116 run_wasmtime(&[
117 "run",
118 "--invoke",
119 "simple",
120 "-Ccache=n",
121 wasm.path().to_str().unwrap(),
122 "4",
123 ])?;
124 assert_eq!(
125 run_wasmtime(&[
126 "run",
127 "--invoke",
128 "get_f32",
129 "-Ccache=n",
130 wasm.path().to_str().unwrap(),
131 ])?,
132 "100\n"
133 );
134 assert_eq!(
135 run_wasmtime(&[
136 "run",
137 "--invoke",
138 "get_f64",
139 "-Ccache=n",
140 wasm.path().to_str().unwrap(),
141 ])?,
142 "100\n"
143 );
144 Ok(())
145}
146
147// Running a wat that traps.
148#[test]

Callers

nothing calls this directly

Calls 6

run_wasmtimeFunction · 0.85
OkFunction · 0.85
to_strMethod · 0.80
build_wasmFunction · 0.70
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected