MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / CheckVersion

Function CheckVersion

Exporter/Plugin/ExporterPluginManager.cpp:69–88  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

67
68 //---------------------------------------------------------------------
69 void CheckVersion(const Plugin::IExportPlugin& exportPlugin,
70 const std::filesystem::path& pluginPath)
71 {
72 const auto functionName = "GetExportPluginVersion";
73 auto pluginVersion = CallPluginfunction(
74 [&]() { return exportPlugin.GetExportPluginVersion(); },
75 functionName,
76 pluginPath);
77 auto currentVersion = Plugin::CurrentExportPluginVersion;
78 if (pluginVersion != currentVersion)
79 {
80 auto error =
81 "IExportPlugin version missmatch: "
82 "OpenCppCoverage version is " +
83 std::to_string(currentVersion) +
84 " whereas the plugin version is " + std::to_string(pluginVersion);
85 throw std::runtime_error(
86 InvalidPluginError(functionName, error, pluginPath));
87 }
88 }
89 }
90
91 //-------------------------------------------------------------------------

Callers 1

ExporterPluginManagerMethod · 0.85

Calls 3

CallPluginfunctionFunction · 0.85
InvalidPluginErrorFunction · 0.85

Tested by

no test coverage detected