From b5d56427307087afaa34197e4fff8a9cc29c2a21 Mon Sep 17 00:00:00 2001 From: "River.Li" Date: Sun, 18 Feb 2024 15:32:19 +0800 Subject: [PATCH] Fix test failures issue due to getting incorrect lib path --- src/inference/src/core.cpp | 6 ++++-- src/inference/tests/functional/ov_core_test.cpp | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/inference/src/core.cpp b/src/inference/src/core.cpp index 0d64afb6009b99..69650f46a1dcf4 100644 --- a/src/inference/src/core.cpp +++ b/src/inference/src/core.cpp @@ -37,13 +37,15 @@ std::string find_plugins_xml(const std::string& xml_file) { // register plugins from default openvino-/plugins.xml config auto xmlConfigFileDefault = ov::util::path_join({ov_library_path, sub_folder, xml_file_name}); - if (ov::util::file_exists(xmlConfigFileDefault)) + if (ov::util::file_exists(xmlConfigFileDefault)) { return xmlConfigFileDefault; + } // 2. in folder with libopenvino.so xmlConfigFileDefault = ov::util::path_join({ov_library_path, xml_file_name}); - if (ov::util::file_exists(xmlConfigFileDefault)) + if (ov::util::file_exists(xmlConfigFileDefault)) { return xmlConfigFileDefault; + } return xml_file; } diff --git a/src/inference/tests/functional/ov_core_test.cpp b/src/inference/tests/functional/ov_core_test.cpp index fdd65233eaccdc..f166527a666a6a 100644 --- a/src/inference/tests/functional/ov_core_test.cpp +++ b/src/inference/tests/functional/ov_core_test.cpp @@ -8,6 +8,7 @@ #include "common_test_utils/common_utils.hpp" #include "common_test_utils/file_utils.hpp" +#include "file_utils.h" #include "openvino/runtime/core.hpp" #include "openvino/util/file_util.hpp" @@ -36,7 +37,7 @@ static void remove_plugin_xml(const std::string& file_name) { TEST(CoreBaseTest, LoadPluginXML) { std::string xml_file_name = "test_plugin.xml"; std::string xml_file_path = - ov::util::get_ov_lib_path() + ov::util::FileTraits::file_separator + xml_file_name; + InferenceEngine::getIELibraryPath() + ov::util::FileTraits::file_separator + xml_file_name; create_plugin_xml(xml_file_path); EXPECT_NO_THROW(ov::Core core(xml_file_name)); remove_plugin_xml(xml_file_path); @@ -45,7 +46,7 @@ TEST(CoreBaseTest, LoadPluginXML) { TEST(CoreBaseTest, LoadPluginDifferentXMLExtension) { std::string xml_file_name = "test_plugin.test"; std::string xml_file_path = - ov::util::get_ov_lib_path() + ov::util::FileTraits::file_separator + xml_file_name; + InferenceEngine::getIELibraryPath() + ov::util::FileTraits::file_separator + xml_file_name; create_plugin_xml(xml_file_path); EXPECT_NO_THROW(ov::Core core(xml_file_name)); remove_plugin_xml(xml_file_path); @@ -54,7 +55,7 @@ TEST(CoreBaseTest, LoadPluginDifferentXMLExtension) { TEST(CoreBaseTest, LoadAbsoluteOVPathPluginXML) { std::string xml_file_name = "test_plugin.xml"; std::string xml_file_path = - ov::util::get_ov_lib_path() + ov::util::FileTraits::file_separator + xml_file_name; + InferenceEngine::getIELibraryPath() + ov::util::FileTraits::file_separator + xml_file_name; create_plugin_xml(xml_file_path); EXPECT_NO_THROW(ov::Core core(xml_file_path)); remove_plugin_xml(xml_file_path); @@ -82,7 +83,8 @@ TEST(CoreBaseTest, LoadOVFolderOverCWPathPluginXML) { std::string xml_file_name = "test_plugin.xml"; std::string cwd_file_path = ov::test::utils::getCurrentWorkingDir() + ov::util::FileTraits::file_separator + xml_file_name; - std::string ov_file_path = ov::util::get_ov_lib_path() + ov::util::FileTraits::file_separator + xml_file_name; + std::string ov_file_path = + InferenceEngine::getIELibraryPath() + ov::util::FileTraits::file_separator + xml_file_name; create_plugin_xml(cwd_file_path); create_plugin_xml(ov_file_path, "2"); ov::Core core(xml_file_name);