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

Function profile_guest

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

Source from the content-addressed store, hash-verified

3092
3093#[test]
3094fn profile_guest() -> Result<()> {
3095 let tmpdir = std::env::temp_dir();
3096 let dir = tmpdir.to_string_lossy();
3097
3098 let output = run_wasmtime_for_output(
3099 &[
3100 &format!("--profile=guest,{dir}/out.json"),
3101 "--env",
3102 "FOO=bar",
3103 "tests/all/cli_tests/print_env.wat",
3104 ],
3105 None,
3106 )?;
3107
3108 let stdout = String::from_utf8_lossy(&output.stdout);
3109 let stderr = String::from_utf8_lossy(&output.stderr);
3110 println!("> stdout:\n{stdout}");
3111 println!("> stderr:\n{stderr}");
3112 assert!(output.status.success());
3113 assert!(!stderr.contains("Error"));
3114 let out_json = std::fs::read_to_string(format!("{dir}/out.json")).unwrap();
3115 println!("> out.json:\n{out_json}");
3116 Ok(())
3117}
3118
3119#[test]
3120fn unreachable_without_wasi() -> Result<()> {

Callers

nothing calls this directly

Calls 4

run_wasmtime_for_outputFunction · 0.85
read_to_stringFunction · 0.85
OkFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected