Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ jobs:
--gtest_output=xml:${INSTALL_TEST_DIR}/TEST-OVCoreUT.xml

- name: OpenVINO Inference Functional Tests
if: ${{ 'false' }} # Ticket: 134410
if: always()
run: |
source ${INSTALL_DIR}/setupvars.sh

Expand Down
12 changes: 11 additions & 1 deletion src/inference/tests/functional/ov_register_plugin_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ using namespace std;

#ifndef OPENVINO_STATIC_LIBRARY

inline void mockPlugin(ov::Core& core, std::shared_ptr<ov::IPlugin>& plugin, std::shared_ptr<void>& m_so) {
namespace {
void mockPlugin(ov::Core& core, std::shared_ptr<ov::IPlugin>& plugin, std::shared_ptr<void>& m_so) {
std::string libraryPath = ov::test::utils::get_mock_engine_path();
if (!m_so)
m_so = ov::util::load_shared_object(libraryPath.c_str());
Expand All @@ -36,6 +37,13 @@ inline void mockPlugin(ov::Core& core, std::shared_ptr<ov::IPlugin>& plugin, std
injectProxyEngine(plugin.get());
}

void clearMockPlugin(const std::shared_ptr<void>& m_so) {
std::string libraryPath = ov::test::utils::get_mock_engine_path();
ASSERT_TRUE(m_so);
ov::test::utils::make_std_function<void()>(m_so, "ClearTargets")();
}
} // namespace

TEST(RegisterPluginTests, getVersionforRegisteredPluginThrows) {
ov::Core core;
auto plugin = std::make_shared<ov::test::utils::MockPlugin>();
Expand All @@ -49,6 +57,7 @@ TEST(RegisterPluginTests, getVersionforRegisteredPluginThrows) {
std::string("mock_registered_engine") + OV_BUILD_POSTFIX),
mock_plugin_name));
ASSERT_THROW(core.get_versions("MOCK_REGISTERED_HARDWARE"), ov::Exception);
clearMockPlugin(m_so);
}

TEST(RegisterPluginTests, getVersionforNoRegisteredPluginNoThrows) {
Expand Down Expand Up @@ -113,6 +122,7 @@ TEST(RegisterPluginTests, registerExistingPluginThrows) {
std::string("mock_engine") + OV_BUILD_POSTFIX),
mock_plugin_name),
ov::Exception);
clearMockPlugin(m_so);
}

inline std::string getPluginFile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,8 @@ OPENVINO_PLUGIN_API void InjectPlugin(ov::IPlugin* target) {
std::lock_guard<std::mutex> lock(targets_mutex);
targets.push(std::make_shared<MockInternalPlugin>(target));
}

OPENVINO_PLUGIN_API void ClearTargets() {
decltype(targets) empty;
std::swap(targets, empty);
}