MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / createModule

Function createModule

test/plugins/wasm_bpf/simple_ringbuf_test.cpp:20–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19namespace {
20WasmEdge::Runtime::Instance::ModuleInstance *createModule() {
21 using namespace std::literals::string_view_literals;
22 WasmEdge::Plugin::Plugin::load(
23 std::filesystem::u8path("../../../plugins/wasm_bpf/" WASMEDGE_LIB_PREFIX
24 "wasmedgePluginWasmBpf" WASMEDGE_LIB_EXTENSION));
25 if (const auto *Plugin = WasmEdge::Plugin::Plugin::find("wasm_bpf"sv)) {
26 if (const auto *Module = Plugin->findModule("wasm_bpf"sv)) {
27 return Module->create().release();
28 }
29 }
30 return nullptr;
31}
32
33std::filesystem::path getAssertsPath() {
34 std::filesystem::path thisFile(__FILE__);

Callers 1

TESTFunction · 0.70

Calls 4

loadFunction · 0.50
findModuleMethod · 0.45
releaseMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected