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

Function TEST

crates/c-api/tests/wasi.cc:8–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace wasmtime;
7
8TEST(WasiConfig, Smoke) {
9 WasiConfig config;
10 config.argv({"x"});
11 config.inherit_argv();
12 config.env({{"x", "y"}});
13 config.inherit_env();
14 EXPECT_FALSE(config.stdin_file("nonexistent"));
15 config.inherit_stdin();
16 EXPECT_FALSE(config.stdout_file("path/to/nonexistent"));
17 config.inherit_stdout();
18 EXPECT_FALSE(config.stderr_file("path/to/nonexistent"));
19 config.inherit_stderr();
20
21 WasiConfig config2;
22 if (config2.preopen_dir("nonexistent", "nonexistent", 0, 0)) {
23 Engine engine;
24 Store store(engine);
25 EXPECT_FALSE(store.context().set_wasi(std::move(config2)));
26 }
27}

Callers

nothing calls this directly

Calls 13

argvMethod · 0.80
inherit_argvMethod · 0.80
stdin_fileMethod · 0.80
stdout_fileMethod · 0.80
stderr_fileMethod · 0.80
preopen_dirMethod · 0.80
set_wasiMethod · 0.80
envMethod · 0.45
inherit_envMethod · 0.45
inherit_stdinMethod · 0.45
inherit_stdoutMethod · 0.45
inherit_stderrMethod · 0.45

Tested by

no test coverage detected