Move unit and func test utils (#18423)
* Move unit and func test utils. Rename targets * Fix1
This commit is contained in:
parent
a7b76522a6
commit
cdef86c366
@ -36,9 +36,9 @@ Once the commands above are executed, the OpenVINO Developer Package is generate
|
||||
* Libraries for tests development:
|
||||
|
||||
* ``openvino::gtest``, ``openvino::gtest_main``, ``openvino::gmock`` - Google Tests framework libraries
|
||||
* ``openvino::commonTestUtils`` - static library with common tests utilities
|
||||
* ``openvino::funcTestUtils`` - static library with functional tests utilities
|
||||
* ``openvino::unitTestUtils`` - static library with unit tests utilities
|
||||
* ``openvino::common_test_utils`` - static library with common tests utilities
|
||||
* ``openvino::func_test_utils`` - static library with functional tests utilities
|
||||
* ``openvino::unit_test_utils`` - static library with unit tests utilities
|
||||
* ``openvino::ngraphFunctions`` - static library with the set of ``ov::Model`` builders
|
||||
* ``openvino::funcSharedTests`` - static library with common functional tests
|
||||
* ``openvino::ngraph_reference`` - static library with operation reference implementations.
|
||||
|
@ -10,7 +10,7 @@ ov_add_test_target(
|
||||
DEPENDENCIES
|
||||
LINK_LIBRARIES
|
||||
gmock
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
offline_transformations
|
||||
sharedTestClasses
|
||||
lptNgraphFunctions
|
||||
|
@ -138,7 +138,7 @@ if(ONNX_TESTS_DEPENDENCIES)
|
||||
endif()
|
||||
|
||||
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.
|
||||
# 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::runtime
|
||||
gtest_main_manifest
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
ADD_CLANG_FORMAT
|
||||
LABELS
|
||||
OV
|
||||
|
@ -18,7 +18,7 @@ target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
PUBLIC
|
||||
engines_test_util offline_transformations
|
||||
common_test_utils funcTestUtils openvino::util
|
||||
common_test_utils func_test_utils openvino::util
|
||||
openvino::runtime
|
||||
PRIVATE
|
||||
cnpy)
|
||||
|
@ -43,8 +43,7 @@ ov_add_test_target(
|
||||
${DEPENDENCIES}
|
||||
LINK_LIBRARIES
|
||||
gmock
|
||||
funcTestUtils
|
||||
common_test_utils
|
||||
func_test_utils
|
||||
INCLUDES
|
||||
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@ -54,4 +53,3 @@ ov_add_test_target(
|
||||
)
|
||||
|
||||
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_internal_plugin_config.hpp"
|
||||
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
|
||||
#include "functional_test_utils/test_model/test_model.hpp"
|
||||
#include "ie_core.hpp"
|
||||
#include "ie_metric_helpers.hpp"
|
||||
#include "ie_remote_context.hpp"
|
||||
#include "ngraph/function.hpp"
|
||||
#include "ngraph_functions/subgraph_builders.hpp"
|
||||
#include "openvino/core/model.hpp"
|
||||
#include "openvino/op/logical_not.hpp"
|
||||
#include "openvino/pass/manager.hpp"
|
||||
#include "openvino/pass/serialize.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/mock_iexecutable_network.hpp"
|
||||
@ -293,7 +295,9 @@ public:
|
||||
sharedObjectLoader = ov::util::load_shared_object(libraryPath.c_str());
|
||||
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 {
|
||||
|
@ -10,7 +10,7 @@ ov_add_test_target(
|
||||
DEPENDENCIES
|
||||
template_extension
|
||||
LINK_LIBRARIES
|
||||
unitTestUtils
|
||||
unit_test_utils
|
||||
ADD_CLANG_FORMAT
|
||||
LABELS
|
||||
OV
|
||||
|
@ -15,7 +15,7 @@ addIeTargetTest(
|
||||
${OpenVINO_SOURCE_DIR}/src/plugins/auto ${CMAKE_CURRENT_SOURCE_DIR} ${OpenVINO_SOURCE_DIR}/src/plugins/auto/src
|
||||
LINK_LIBRARIES
|
||||
ngraphFunctions
|
||||
unitTestUtils
|
||||
unit_test_utils
|
||||
ADD_CPPLINT
|
||||
DEPENDENCIES
|
||||
template_extension
|
||||
|
@ -20,7 +20,7 @@ addIeTargetTest(
|
||||
${OpenVINO_SOURCE_DIR}/src/plugins/auto_batch/src
|
||||
${SHARED_HEADERS_DIR}
|
||||
LINK_LIBRARIES
|
||||
unitTestUtils
|
||||
unit_test_utils
|
||||
ngraphFunctions
|
||||
DEPENDENCIES
|
||||
mock_engine
|
||||
|
@ -49,7 +49,7 @@ addIeTargetTest(
|
||||
inference_engine_lp_transformations
|
||||
ov_shape_inference
|
||||
inference_engine_s
|
||||
unitTestUtils
|
||||
unit_test_utils
|
||||
ngraphFunctions
|
||||
snippetsNgraphFunctions
|
||||
snippets_test_utils
|
||||
|
@ -15,7 +15,7 @@ ov_add_test_target(
|
||||
DEPENDENCIES
|
||||
LINK_LIBRARIES
|
||||
gmock
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
sharedTestClasses
|
||||
lptNgraphFunctions
|
||||
inference_engine_legacy
|
||||
|
@ -79,7 +79,7 @@ endif()
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
||||
# static libraries
|
||||
inference_engine_s # need to have this explicitly for USE_STATIC_IE
|
||||
unitTestUtils
|
||||
unit_test_utils
|
||||
ieTestHelpers_s
|
||||
${TEST_DEPS}
|
||||
|
||||
|
@ -10,12 +10,11 @@ ov_add_test_target(
|
||||
DEPENDENCIES
|
||||
openvino::runtime
|
||||
mock_engine
|
||||
funcTestUtils
|
||||
LINK_LIBRARIES
|
||||
openvino::runtime::dev
|
||||
gtest
|
||||
gtest_main
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
ADD_CLANG_FORMAT
|
||||
LABELS
|
||||
PROXY_PLUGIN
|
||||
|
@ -30,7 +30,6 @@ endif()
|
||||
ov_deprecated_no_errors()
|
||||
|
||||
add_subdirectory(ngraph_helpers)
|
||||
add_subdirectory(ie_test_utils)
|
||||
add_subdirectory(test_utils)
|
||||
add_subdirectory(engines_util)
|
||||
|
||||
|
@ -64,7 +64,7 @@ This is OpenVINO Inference Engine testing framework. OpenVINO Inference Engine t
|
||||
* **Inference Engine tests utilities**
|
||||
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.
|
||||
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.
|
||||
|
||||
> **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
|
||||
gflags
|
||||
inference_engine
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
openvino::pugixml
|
||||
)
|
||||
|
||||
|
@ -14,7 +14,7 @@ addIeTargetTest(
|
||||
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper/include
|
||||
LINK_LIBRARIES
|
||||
PRIVATE
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
openvino::runtime
|
||||
openvino::pugixml
|
||||
ADD_CPPLINT
|
||||
|
@ -7,7 +7,7 @@ set(TARGET_NAME subgraphs_dumper)
|
||||
list(APPEND LIBRARIES
|
||||
gflags
|
||||
openvino::runtime
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
openvino::pugixml
|
||||
)
|
||||
|
||||
|
@ -9,13 +9,13 @@ addIeTargetTest(
|
||||
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ADDITIONAL_SOURCE_DIRS
|
||||
${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
|
||||
INCLUDES
|
||||
${OpenVINO_SOURCE_DIR}/src/tests/functional/plugin/conformance/subgraphs_dumper_new/include
|
||||
LINK_LIBRARIES
|
||||
PRIVATE
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
openvino::runtime
|
||||
openvino::pugixml
|
||||
ADD_CPPLINT
|
||||
|
@ -63,8 +63,8 @@ addIeTarget(
|
||||
LINK_LIBRARIES
|
||||
PUBLIC
|
||||
openvino::pugixml
|
||||
funcTestUtils
|
||||
common_test_utils
|
||||
func_test_utils
|
||||
ngraphFunctions
|
||||
lptNgraphFunctions
|
||||
sharedTestClasses
|
||||
|
@ -18,7 +18,7 @@ addIeTarget(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
LINK_LIBRARIES
|
||||
PRIVATE
|
||||
funcTestUtils
|
||||
func_test_utils
|
||||
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)
|
||||
add_subdirectory(common_test_utils)
|
||||
add_subdirectory(unit_test_utils)
|
||||
endif()
|
||||
|
||||
if(ENABLE_FUNCTIONAL_TESTS)
|
||||
add_subdirectory(functional_test_utils)
|
||||
endif()
|
||||
|
@ -77,7 +77,7 @@ function(add_common_utils ADD_TARGET_NAME)
|
||||
$<TARGET_PROPERTY:openvino::runtime,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
PRIVATE
|
||||
$<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})
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set(TARGET_NAME funcTestUtils)
|
||||
set(TARGET_NAME func_test_utils)
|
||||
|
||||
addIeTarget(
|
||||
NAME ${TARGET_NAME}
|
||||
TYPE STATIC
|
||||
ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
ADD_CPPLINT
|
||||
DEVELOPER_PACKAGE
|
||||
tests
|
@ -6,7 +6,7 @@ if(SUGGEST_OVERRIDE_SUPPORTED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
|
||||
endif()
|
||||
|
||||
set(TARGET_NAME unitTestUtils)
|
||||
set(TARGET_NAME unit_test_utils)
|
||||
|
||||
add_subdirectory(mocks/mock_engine)
|
||||
|
Loading…
Reference in New Issue
Block a user