Move unit and func test utils (#18423)
* Move unit and func test utils. Rename targets * Fix1
This commit is contained in:
@@ -36,9 +36,9 @@ Once the commands above are executed, the OpenVINO Developer Package is generate
|
|||||||
* Libraries for tests development:
|
* Libraries for tests development:
|
||||||
|
|
||||||
* ``openvino::gtest``, ``openvino::gtest_main``, ``openvino::gmock`` - Google Tests framework libraries
|
* ``openvino::gtest``, ``openvino::gtest_main``, ``openvino::gmock`` - Google Tests framework libraries
|
||||||
* ``openvino::commonTestUtils`` - static library with common tests utilities
|
* ``openvino::common_test_utils`` - static library with common tests utilities
|
||||||
* ``openvino::funcTestUtils`` - static library with functional tests utilities
|
* ``openvino::func_test_utils`` - static library with functional tests utilities
|
||||||
* ``openvino::unitTestUtils`` - static library with unit tests utilities
|
* ``openvino::unit_test_utils`` - static library with unit tests utilities
|
||||||
* ``openvino::ngraphFunctions`` - static library with the set of ``ov::Model`` builders
|
* ``openvino::ngraphFunctions`` - static library with the set of ``ov::Model`` builders
|
||||||
* ``openvino::funcSharedTests`` - static library with common functional tests
|
* ``openvino::funcSharedTests`` - static library with common functional tests
|
||||||
* ``openvino::ngraph_reference`` - static library with operation reference implementations.
|
* ``openvino::ngraph_reference`` - static library with operation reference implementations.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ ov_add_test_target(
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
gmock
|
gmock
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
offline_transformations
|
offline_transformations
|
||||||
sharedTestClasses
|
sharedTestClasses
|
||||||
lptNgraphFunctions
|
lptNgraphFunctions
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ if(ONNX_TESTS_DEPENDENCIES)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(ov_onnx_frontend_tests PRIVATE engines_test_util gtest_main_manifest openvino::runtime::dev
|
target_link_libraries(ov_onnx_frontend_tests PRIVATE engines_test_util gtest_main_manifest openvino::runtime::dev
|
||||||
openvino_onnx_frontend onnx_common funcTestUtils)
|
openvino_onnx_frontend onnx_common func_test_utils)
|
||||||
|
|
||||||
# It's needed by onnx_import_library.cpp and onnx_import_exceptions.cpp tests to include onnx_pb.h.
|
# It's needed by onnx_import_library.cpp and onnx_import_exceptions.cpp tests to include onnx_pb.h.
|
||||||
# Not linking statically to libprotobuf (linked into libonnx) avoids false-failing onnx_editor tests.
|
# Not linking statically to libprotobuf (linked into libonnx) avoids false-failing onnx_editor tests.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ ov_add_test_target(
|
|||||||
openvino_paddle_frontend
|
openvino_paddle_frontend
|
||||||
openvino::runtime
|
openvino::runtime
|
||||||
gtest_main_manifest
|
gtest_main_manifest
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
ADD_CLANG_FORMAT
|
ADD_CLANG_FORMAT
|
||||||
LABELS
|
LABELS
|
||||||
OV
|
OV
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
|
|||||||
target_link_libraries(${TARGET_NAME}
|
target_link_libraries(${TARGET_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
engines_test_util offline_transformations
|
engines_test_util offline_transformations
|
||||||
common_test_utils funcTestUtils openvino::util
|
common_test_utils func_test_utils openvino::util
|
||||||
openvino::runtime
|
openvino::runtime
|
||||||
PRIVATE
|
PRIVATE
|
||||||
cnpy)
|
cnpy)
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ ov_add_test_target(
|
|||||||
${DEPENDENCIES}
|
${DEPENDENCIES}
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
gmock
|
gmock
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
common_test_utils
|
|
||||||
INCLUDES
|
INCLUDES
|
||||||
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
|
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
@@ -54,4 +53,3 @@ ov_add_test_target(
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_compile_definitions(${TARGET_NAME} ${COMPILE_DEFINITIONS})
|
add_compile_definitions(${TARGET_NAME} ${COMPILE_DEFINITIONS})
|
||||||
|
|
||||||
|
|||||||
@@ -19,13 +19,15 @@
|
|||||||
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
|
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
|
||||||
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
|
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
|
||||||
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
|
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
|
||||||
#include "functional_test_utils/test_model/test_model.hpp"
|
|
||||||
#include "ie_core.hpp"
|
#include "ie_core.hpp"
|
||||||
#include "ie_metric_helpers.hpp"
|
#include "ie_metric_helpers.hpp"
|
||||||
#include "ie_remote_context.hpp"
|
#include "ie_remote_context.hpp"
|
||||||
#include "ngraph/function.hpp"
|
#include "ngraph/function.hpp"
|
||||||
|
#include "ngraph_functions/subgraph_builders.hpp"
|
||||||
#include "openvino/core/model.hpp"
|
#include "openvino/core/model.hpp"
|
||||||
#include "openvino/op/logical_not.hpp"
|
#include "openvino/op/logical_not.hpp"
|
||||||
|
#include "openvino/pass/manager.hpp"
|
||||||
|
#include "openvino/pass/serialize.hpp"
|
||||||
#include "openvino/util/file_util.hpp"
|
#include "openvino/util/file_util.hpp"
|
||||||
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"
|
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"
|
||||||
#include "unit_test_utils/mocks/mock_iexecutable_network.hpp"
|
#include "unit_test_utils/mocks/mock_iexecutable_network.hpp"
|
||||||
@@ -293,7 +295,9 @@ public:
|
|||||||
sharedObjectLoader = ov::util::load_shared_object(libraryPath.c_str());
|
sharedObjectLoader = ov::util::load_shared_object(libraryPath.c_str());
|
||||||
injectProxyEngine = make_std_function<void(IInferencePlugin*)>("InjectProxyEngine");
|
injectProxyEngine = make_std_function<void(IInferencePlugin*)>("InjectProxyEngine");
|
||||||
|
|
||||||
FuncTestUtils::TestModel::generateTestModel(modelName, weightsName);
|
ov::pass::Manager manager;
|
||||||
|
manager.register_pass<ov::pass::Serialize>(modelName, weightsName);
|
||||||
|
manager.run_passes(ngraph::builder::subgraph::makeConvPoolRelu({1, 3, 227, 227}, ov::element::Type_t::f32));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TearDown() override {
|
void TearDown() override {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ ov_add_test_target(
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
template_extension
|
template_extension
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
unitTestUtils
|
unit_test_utils
|
||||||
ADD_CLANG_FORMAT
|
ADD_CLANG_FORMAT
|
||||||
LABELS
|
LABELS
|
||||||
OV
|
OV
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ addIeTargetTest(
|
|||||||
${OpenVINO_SOURCE_DIR}/src/plugins/auto ${CMAKE_CURRENT_SOURCE_DIR} ${OpenVINO_SOURCE_DIR}/src/plugins/auto/src
|
${OpenVINO_SOURCE_DIR}/src/plugins/auto ${CMAKE_CURRENT_SOURCE_DIR} ${OpenVINO_SOURCE_DIR}/src/plugins/auto/src
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
ngraphFunctions
|
ngraphFunctions
|
||||||
unitTestUtils
|
unit_test_utils
|
||||||
ADD_CPPLINT
|
ADD_CPPLINT
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
template_extension
|
template_extension
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ addIeTargetTest(
|
|||||||
${OpenVINO_SOURCE_DIR}/src/plugins/auto_batch/src
|
${OpenVINO_SOURCE_DIR}/src/plugins/auto_batch/src
|
||||||
${SHARED_HEADERS_DIR}
|
${SHARED_HEADERS_DIR}
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
unitTestUtils
|
unit_test_utils
|
||||||
ngraphFunctions
|
ngraphFunctions
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
mock_engine
|
mock_engine
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ addIeTargetTest(
|
|||||||
inference_engine_lp_transformations
|
inference_engine_lp_transformations
|
||||||
ov_shape_inference
|
ov_shape_inference
|
||||||
inference_engine_s
|
inference_engine_s
|
||||||
unitTestUtils
|
unit_test_utils
|
||||||
ngraphFunctions
|
ngraphFunctions
|
||||||
snippetsNgraphFunctions
|
snippetsNgraphFunctions
|
||||||
snippets_test_utils
|
snippets_test_utils
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ ov_add_test_target(
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
gmock
|
gmock
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
sharedTestClasses
|
sharedTestClasses
|
||||||
lptNgraphFunctions
|
lptNgraphFunctions
|
||||||
inference_engine_legacy
|
inference_engine_legacy
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ endif()
|
|||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
target_link_libraries(${TARGET_NAME} PRIVATE
|
||||||
# static libraries
|
# static libraries
|
||||||
inference_engine_s # need to have this explicitly for USE_STATIC_IE
|
inference_engine_s # need to have this explicitly for USE_STATIC_IE
|
||||||
unitTestUtils
|
unit_test_utils
|
||||||
ieTestHelpers_s
|
ieTestHelpers_s
|
||||||
${TEST_DEPS}
|
${TEST_DEPS}
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,11 @@ ov_add_test_target(
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
openvino::runtime
|
openvino::runtime
|
||||||
mock_engine
|
mock_engine
|
||||||
funcTestUtils
|
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
openvino::runtime::dev
|
openvino::runtime::dev
|
||||||
gtest
|
gtest
|
||||||
gtest_main
|
gtest_main
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
ADD_CLANG_FORMAT
|
ADD_CLANG_FORMAT
|
||||||
LABELS
|
LABELS
|
||||||
PROXY_PLUGIN
|
PROXY_PLUGIN
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ endif()
|
|||||||
ov_deprecated_no_errors()
|
ov_deprecated_no_errors()
|
||||||
|
|
||||||
add_subdirectory(ngraph_helpers)
|
add_subdirectory(ngraph_helpers)
|
||||||
add_subdirectory(ie_test_utils)
|
|
||||||
add_subdirectory(test_utils)
|
add_subdirectory(test_utils)
|
||||||
add_subdirectory(engines_util)
|
add_subdirectory(engines_util)
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ This is OpenVINO Inference Engine testing framework. OpenVINO Inference Engine t
|
|||||||
* **Inference Engine tests utilities**
|
* **Inference Engine tests utilities**
|
||||||
The set of utilities which are used by the Inference Engine Functional and Unit tests. Different helper functions,
|
The set of utilities which are used by the Inference Engine Functional and Unit tests. Different helper functions,
|
||||||
blob comparators, OS-specific constants, etc. are implemented within the utilities.
|
blob comparators, OS-specific constants, etc. are implemented within the utilities.
|
||||||
Internal namespaces (for example, `CommonTestUtils::`, `FuncTestUtils::` or `UnitTestUtils::`) must be used to
|
Internal namespaces (for example, `common_test_utils::`, `func_test_utils::` or `unit_test_utils::`) must be used to
|
||||||
separate utilities by domains.
|
separate utilities by domains.
|
||||||
|
|
||||||
> **NOTE**: All the utilities libraries are added to the developer package and available for closed source
|
> **NOTE**: All the utilities libraries are added to the developer package and available for closed source
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ set(TARGET_NAME subgraphsDumper)
|
|||||||
list(APPEND LIBRARIES
|
list(APPEND LIBRARIES
|
||||||
gflags
|
gflags
|
||||||
inference_engine
|
inference_engine
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
openvino::pugixml
|
openvino::pugixml
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ addIeTargetTest(
|
|||||||
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper/include
|
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper/include
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
PRIVATE
|
PRIVATE
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
openvino::runtime
|
openvino::runtime
|
||||||
openvino::pugixml
|
openvino::pugixml
|
||||||
ADD_CPPLINT
|
ADD_CPPLINT
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ set(TARGET_NAME subgraphs_dumper)
|
|||||||
list(APPEND LIBRARIES
|
list(APPEND LIBRARIES
|
||||||
gflags
|
gflags
|
||||||
openvino::runtime
|
openvino::runtime
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
openvino::pugixml
|
openvino::pugixml
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ addIeTargetTest(
|
|||||||
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
ADDITIONAL_SOURCE_DIRS
|
ADDITIONAL_SOURCE_DIRS
|
||||||
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper_new/src
|
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper_new/src
|
||||||
EXCLUDED_SOURCE_PATHS
|
EXCLUDED_SOURCE_PATHS
|
||||||
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper_new/src/main.cpp
|
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper_new/src/main.cpp
|
||||||
INCLUDES
|
INCLUDES
|
||||||
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper_new/include
|
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper_new/include
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
PRIVATE
|
PRIVATE
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
openvino::runtime
|
openvino::runtime
|
||||||
openvino::pugixml
|
openvino::pugixml
|
||||||
ADD_CPPLINT
|
ADD_CPPLINT
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ addIeTarget(
|
|||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
PUBLIC
|
PUBLIC
|
||||||
openvino::pugixml
|
openvino::pugixml
|
||||||
funcTestUtils
|
|
||||||
common_test_utils
|
common_test_utils
|
||||||
|
func_test_utils
|
||||||
ngraphFunctions
|
ngraphFunctions
|
||||||
lptNgraphFunctions
|
lptNgraphFunctions
|
||||||
sharedTestClasses
|
sharedTestClasses
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ addIeTarget(
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
PRIVATE
|
PRIVATE
|
||||||
funcTestUtils
|
func_test_utils
|
||||||
ngraphFunctions
|
ngraphFunctions
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
# Copyright (C) 2018-2023 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
if(ENABLE_TESTS)
|
|
||||||
add_subdirectory(unit_test_utils)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_FUNCTIONAL_TESTS)
|
|
||||||
add_subdirectory(functional_test_utils)
|
|
||||||
endif()
|
|
||||||
@@ -4,4 +4,9 @@
|
|||||||
|
|
||||||
if(ENABLE_TESTS)
|
if(ENABLE_TESTS)
|
||||||
add_subdirectory(common_test_utils)
|
add_subdirectory(common_test_utils)
|
||||||
|
add_subdirectory(unit_test_utils)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_FUNCTIONAL_TESTS)
|
||||||
|
add_subdirectory(functional_test_utils)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function(add_common_utils ADD_TARGET_NAME)
|
|||||||
$<TARGET_PROPERTY:openvino::runtime,INTERFACE_INCLUDE_DIRECTORIES>
|
$<TARGET_PROPERTY:openvino::runtime,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
PRIVATE
|
PRIVATE
|
||||||
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>)
|
$<TARGET_PROPERTY:openvino::runtime::dev,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
target_include_directories(${ADD_TARGET_NAME} SYSTEM PUBLIC ${IE_TESTS_ROOT}/ie_test_utils)
|
target_include_directories(${ADD_TARGET_NAME} SYSTEM PUBLIC ${IE_TESTS_ROOT}/test_utils)
|
||||||
|
|
||||||
target_compile_definitions(${ADD_TARGET_NAME} PUBLIC ${ARGN})
|
target_compile_definitions(${ADD_TARGET_NAME} PUBLIC ${ARGN})
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
set(TARGET_NAME funcTestUtils)
|
set(TARGET_NAME func_test_utils)
|
||||||
|
|
||||||
addIeTarget(
|
addIeTarget(
|
||||||
NAME ${TARGET_NAME}
|
NAME ${TARGET_NAME}
|
||||||
TYPE STATIC
|
TYPE STATIC
|
||||||
ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
ADD_CPPLINT
|
ADD_CPPLINT
|
||||||
DEVELOPER_PACKAGE
|
DEVELOPER_PACKAGE
|
||||||
tests
|
tests
|
||||||
@@ -6,7 +6,7 @@ if(SUGGEST_OVERRIDE_SUPPORTED)
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(TARGET_NAME unitTestUtils)
|
set(TARGET_NAME unit_test_utils)
|
||||||
|
|
||||||
add_subdirectory(mocks/mock_engine)
|
add_subdirectory(mocks/mock_engine)
|
||||||
|
|
||||||
Reference in New Issue
Block a user