| 32 | } |
| 33 | |
| 34 | std::unique_ptr<WasmEdge::Runtime::Instance::ModuleInstance> createModuleCPP() { |
| 35 | using namespace std::literals::string_view_literals; |
| 36 | WasmEdge::Plugin::Plugin::load(std::filesystem::u8path( |
| 37 | "./" WASMEDGE_LIB_PREFIX |
| 38 | "wasmedgePluginTestModuleCPP" WASMEDGE_LIB_EXTENSION)); |
| 39 | if (const auto *Plugin = |
| 40 | WasmEdge::Plugin::Plugin::find("wasmedge_plugintest_cpp"sv)) { |
| 41 | WasmEdge::PO::ArgumentParser Parser; |
| 42 | Plugin->registerOptions(Parser); |
| 43 | Parser.set_raw_value<std::string>("name"sv, std::string("test_name")); |
| 44 | Parser.set_raw_value<std::vector<std::string>>( |
| 45 | "arg"sv, std::vector<std::string>({"arg0", "arg1", "arg2", "arg3"})); |
| 46 | Parser.set_raw_value("opt"sv); |
| 47 | if (const auto *Module = |
| 48 | Plugin->findModule("wasmedge_plugintest_cpp_module"sv)) { |
| 49 | return Module->create(); |
| 50 | } |
| 51 | } |
| 52 | return {}; |
| 53 | } |
| 54 | } // namespace |
| 55 | |
| 56 | TEST(wasmedgePluginTests, CPP_Run) { |
no test coverage detected