diff --git a/src/core/tests/CMakeLists.txt b/src/core/tests/CMakeLists.txt index 191edb661b5..f99c529ffea 100644 --- a/src/core/tests/CMakeLists.txt +++ b/src/core/tests/CMakeLists.txt @@ -581,6 +581,7 @@ endif() target_link_libraries(ov_core_unit_tests PRIVATE ngraph_test_util engines_test_util + commonTestUtils ngraph_reference ngraph::builder openvino::util diff --git a/src/core/tests/build_graph.cpp b/src/core/tests/build_graph.cpp index 3084a9d520f..ba513cb3445 100644 --- a/src/core/tests/build_graph.cpp +++ b/src/core/tests/build_graph.cpp @@ -5,13 +5,13 @@ #include #include +#include "common_test_utils/graph_comparator.hpp" #include "gtest/gtest.h" #include "ngraph/builder/autobroadcast.hpp" #include "ngraph/file_util.hpp" #include "ngraph/ngraph.hpp" #include "ngraph/opsets/opset5.hpp" #include "ngraph/opsets/opset7.hpp" -#include "util/graph_comparator.hpp" #include "util/test_tools.hpp" NGRAPH_SUPPRESS_DEPRECATED_START diff --git a/src/core/tests/constant_folding.cpp b/src/core/tests/constant_folding.cpp index 9ffb9b2fd85..95a92513c5e 100644 --- a/src/core/tests/constant_folding.cpp +++ b/src/core/tests/constant_folding.cpp @@ -6,6 +6,7 @@ #include +#include "common_test_utils/ngraph_test_utils.hpp" #include "gtest/gtest.h" #include "ngraph/ngraph.hpp" #include "ngraph/opsets/opset1.hpp" diff --git a/src/core/tests/graph_rewrite.cpp b/src/core/tests/graph_rewrite.cpp index da40e1202bd..a7276b76541 100644 --- a/src/core/tests/graph_rewrite.cpp +++ b/src/core/tests/graph_rewrite.cpp @@ -4,10 +4,10 @@ #include +#include #include #include #include -#include NGRAPH_SUPPRESS_DEPRECATED_START diff --git a/src/core/tests/onnx/onnx_import.in.cpp b/src/core/tests/onnx/onnx_import.in.cpp index 56c82f41ac9..dcb3e495db8 100644 --- a/src/core/tests/onnx/onnx_import.in.cpp +++ b/src/core/tests/onnx/onnx_import.in.cpp @@ -39,6 +39,7 @@ #include "util/test_control.hpp" #include "util/test_tools.hpp" #include "util/type_prop.hpp" +#include "common_test_utils/ngraph_test_utils.hpp" NGRAPH_SUPPRESS_DEPRECATED_START diff --git a/src/core/tests/onnx/onnx_import_quant.in.cpp b/src/core/tests/onnx/onnx_import_quant.in.cpp index 2c93c43e5c0..e92ac768bce 100644 --- a/src/core/tests/onnx/onnx_import_quant.in.cpp +++ b/src/core/tests/onnx/onnx_import_quant.in.cpp @@ -13,6 +13,7 @@ #include #include +#include "common_test_utils/ngraph_test_utils.hpp" #include "engines_util/test_case.hpp" #include "engines_util/test_engines.hpp" #include "gtest/gtest.h" diff --git a/src/core/tests/onnx/onnx_import_rnn.in.cpp b/src/core/tests/onnx/onnx_import_rnn.in.cpp index a7947189ea4..44db1c044c5 100644 --- a/src/core/tests/onnx/onnx_import_rnn.in.cpp +++ b/src/core/tests/onnx/onnx_import_rnn.in.cpp @@ -13,6 +13,7 @@ #include #include +#include "common_test_utils/ngraph_test_utils.hpp" #include "engines_util/test_case.hpp" #include "engines_util/test_engines.hpp" #include "gtest/gtest.h" diff --git a/src/core/tests/op_eval/gelu.cpp b/src/core/tests/op_eval/gelu.cpp index c1ced09df89..c49f43c1425 100644 --- a/src/core/tests/op_eval/gelu.cpp +++ b/src/core/tests/op_eval/gelu.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/hsigmoid.cpp b/src/core/tests/op_eval/hsigmoid.cpp index d0bb86076fd..29b84c54c25 100644 --- a/src/core/tests/op_eval/hsigmoid.cpp +++ b/src/core/tests/op_eval/hsigmoid.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/hswish.cpp b/src/core/tests/op_eval/hswish.cpp index ebc43ea5313..ab67b809b74 100644 --- a/src/core/tests/op_eval/hswish.cpp +++ b/src/core/tests/op_eval/hswish.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/interpolate.cpp b/src/core/tests/op_eval/interpolate.cpp index e173fb91fba..7090c12d5dd 100644 --- a/src/core/tests/op_eval/interpolate.cpp +++ b/src/core/tests/op_eval/interpolate.cpp @@ -11,6 +11,7 @@ #include "gtest/gtest.h" #include "ngraph/op/constant.hpp" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/all_close_f.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/matmul.cpp b/src/core/tests/op_eval/matmul.cpp index 1f570063bcd..e7052b05a46 100644 --- a/src/core/tests/op_eval/matmul.cpp +++ b/src/core/tests/op_eval/matmul.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "util/all_close_f.hpp" using namespace std; diff --git a/src/core/tests/op_eval/memory.cpp b/src/core/tests/op_eval/memory.cpp index 3d992b9cd75..3545e528a3c 100644 --- a/src/core/tests/op_eval/memory.cpp +++ b/src/core/tests/op_eval/memory.cpp @@ -10,6 +10,7 @@ #include "ngraph/op/util/variable.hpp" #include "ngraph/op/util/variable_context.hpp" #include "ngraph/opsets/opset7.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "ngraph/variant.hpp" #include "util/all_close_f.hpp" diff --git a/src/core/tests/op_eval/mish.cpp b/src/core/tests/op_eval/mish.cpp index 4d83aaa1ff1..249759d68d8 100644 --- a/src/core/tests/op_eval/mish.cpp +++ b/src/core/tests/op_eval/mish.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" #include "util/type_prop.hpp" diff --git a/src/core/tests/op_eval/non_zero.cpp b/src/core/tests/op_eval/non_zero.cpp index e962a6b0d21..b977bc512c4 100644 --- a/src/core/tests/op_eval/non_zero.cpp +++ b/src/core/tests/op_eval/non_zero.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" #include "util/type_prop.hpp" diff --git a/src/core/tests/op_eval/roi_align.cpp b/src/core/tests/op_eval/roi_align.cpp index 151cd9bcb87..01622b6bcc3 100644 --- a/src/core/tests/op_eval/roi_align.cpp +++ b/src/core/tests/op_eval/roi_align.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/all_close_f.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/round.cpp b/src/core/tests/op_eval/round.cpp index 01bb4be88ef..e8eb0f8e9c6 100644 --- a/src/core/tests/op_eval/round.cpp +++ b/src/core/tests/op_eval/round.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/softplus.cpp b/src/core/tests/op_eval/softplus.cpp index f9ea3bb9d60..505b8890473 100644 --- a/src/core/tests/op_eval/softplus.cpp +++ b/src/core/tests/op_eval/softplus.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/split.cpp b/src/core/tests/op_eval/split.cpp index db44f02466a..24273ef771e 100644 --- a/src/core/tests/op_eval/split.cpp +++ b/src/core/tests/op_eval/split.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" #include "util/type_prop.hpp" diff --git a/src/core/tests/op_eval/strided_slice.cpp b/src/core/tests/op_eval/strided_slice.cpp index e538dab0a90..a8d7532b8b6 100644 --- a/src/core/tests/op_eval/strided_slice.cpp +++ b/src/core/tests/op_eval/strided_slice.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" #include "util/type_prop.hpp" diff --git a/src/core/tests/op_eval/swish.cpp b/src/core/tests/op_eval/swish.cpp index 17856f40e78..5c1b499ac48 100644 --- a/src/core/tests/op_eval/swish.cpp +++ b/src/core/tests/op_eval/swish.cpp @@ -10,6 +10,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/transpose.cpp b/src/core/tests/op_eval/transpose.cpp index 4a24d726b09..8aad4553bc3 100644 --- a/src/core/tests/op_eval/transpose.cpp +++ b/src/core/tests/op_eval/transpose.cpp @@ -11,6 +11,7 @@ #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/reference/transpose.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/all_close_f.hpp" #include "util/test_tools.hpp" diff --git a/src/core/tests/op_eval/variadic_split.cpp b/src/core/tests/op_eval/variadic_split.cpp index 014bbcfa47a..9f8858d3168 100644 --- a/src/core/tests/op_eval/variadic_split.cpp +++ b/src/core/tests/op_eval/variadic_split.cpp @@ -9,6 +9,7 @@ #include "engines_util/execute_tools.hpp" #include "gtest/gtest.h" #include "ngraph/runtime/host_tensor.hpp" +#include "ngraph/util.hpp" #include "ngraph/validation_util.hpp" #include "util/test_tools.hpp" #include "util/type_prop.hpp" diff --git a/src/core/tests/pass/serialization/cleanup.cpp b/src/core/tests/pass/serialization/cleanup.cpp index 3c95576a791..2d20d872b1c 100644 --- a/src/core/tests/pass/serialization/cleanup.cpp +++ b/src/core/tests/pass/serialization/cleanup.cpp @@ -8,7 +8,6 @@ #include "openvino/opsets/opset8.hpp" #include "openvino/pass/serialize.hpp" -#include "util/graph_comparator.hpp" #include "util/test_common.hpp" class SerializationCleanupTest : public ov::test::TestsCommon { diff --git a/src/core/tests/pass/serialization/deterministicity.cpp b/src/core/tests/pass/serialization/deterministicity.cpp index e015dbce979..64f07aee93c 100644 --- a/src/core/tests/pass/serialization/deterministicity.cpp +++ b/src/core/tests/pass/serialization/deterministicity.cpp @@ -9,7 +9,6 @@ #include "openvino/pass/serialize.hpp" #include "openvino/util/file_util.hpp" #include "read_ir.hpp" -#include "util/graph_comparator.hpp" #include "util/test_common.hpp" class SerializationDeterministicityTest : public ov::test::TestsCommon { diff --git a/src/core/tests/pass/serialization/from_model.cpp b/src/core/tests/pass/serialization/from_model.cpp index 8615349881b..ea8e14734d9 100644 --- a/src/core/tests/pass/serialization/from_model.cpp +++ b/src/core/tests/pass/serialization/from_model.cpp @@ -6,10 +6,10 @@ #include +#include "common_test_utils/graph_comparator.hpp" #include "openvino/pass/serialize.hpp" #include "openvino/util/file_util.hpp" #include "read_ir.hpp" -#include "util/graph_comparator.hpp" #include "util/test_common.hpp" using ModelBuilder = std::function()>; diff --git a/src/core/tests/pass/serialization/serialize.cpp b/src/core/tests/pass/serialization/serialize.cpp index ad9400ee958..1537deed7d2 100644 --- a/src/core/tests/pass/serialization/serialize.cpp +++ b/src/core/tests/pass/serialization/serialize.cpp @@ -8,11 +8,11 @@ #include +#include "common_test_utils/graph_comparator.hpp" #include "ngraph/pass/manager.hpp" #include "ngraph/pass/serialize.hpp" #include "openvino/util/file_util.hpp" #include "read_ir.hpp" -#include "util/graph_comparator.hpp" #include "util/test_common.hpp" using SerializationParams = std::tuple; diff --git a/src/core/tests/pass/serialization/tensor_names.cpp b/src/core/tests/pass/serialization/tensor_names.cpp index afec3176ac6..9f1caf26e35 100644 --- a/src/core/tests/pass/serialization/tensor_names.cpp +++ b/src/core/tests/pass/serialization/tensor_names.cpp @@ -7,7 +7,7 @@ #include "openvino/opsets/opset8.hpp" #include "openvino/pass/serialize.hpp" #include "read_ir.hpp" -#include "util/graph_comparator.hpp" +#include "common_test_utils/graph_comparator.hpp" #include "util/test_common.hpp" class TensorNameSerializationTest : public ov::test::TestsCommon { diff --git a/src/core/tests/pattern.cpp b/src/core/tests/pattern.cpp index c137145d991..e982e3f45e1 100644 --- a/src/core/tests/pattern.cpp +++ b/src/core/tests/pattern.cpp @@ -3,6 +3,7 @@ // #include +#include #include #include #include diff --git a/src/core/tests/visitors/op/if.cpp b/src/core/tests/visitors/op/if.cpp index ab90b9a0a8f..518f978e8d2 100644 --- a/src/core/tests/visitors/op/if.cpp +++ b/src/core/tests/visitors/op/if.cpp @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "common_test_utils/graph_comparator.hpp" #include "gtest/gtest.h" #include "ngraph/ngraph.hpp" #include "ngraph/op/util/attr_types.hpp" #include "ngraph/opsets/opset8.hpp" -#include "util/graph_comparator.hpp" #include "util/visitor.hpp" using namespace std; diff --git a/src/frontends/tests/frontend/shared/src/json_config.cpp b/src/frontends/tests/frontend/shared/src/json_config.cpp index 6caff415aab..91fbac6e877 100644 --- a/src/frontends/tests/frontend/shared/src/json_config.cpp +++ b/src/frontends/tests/frontend/shared/src/json_config.cpp @@ -4,11 +4,11 @@ #include "json_config.hpp" +#include #include #include #include #include -#include #include "utils.hpp" diff --git a/src/tests/engines_util/execute_tools.hpp b/src/tests/engines_util/execute_tools.hpp index 901a547c855..e31d8babb5d 100644 --- a/src/tests/engines_util/execute_tools.hpp +++ b/src/tests/engines_util/execute_tools.hpp @@ -13,16 +13,15 @@ #include #include -#include "graph_comparator.hpp" #include "gtest/gtest.h" #include "ngraph/file_util.hpp" +#include "ngraph/function.hpp" #include "ngraph/log.hpp" #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/tensor.hpp" #include "ngraph/type/element_type_traits.hpp" -#include "test_tools.hpp" namespace ngraph { class TestOpMultiOut : public op::Op { diff --git a/src/tests/engines_util/random.hpp b/src/tests/engines_util/random.hpp index 36ab7ad1178..487984a822c 100644 --- a/src/tests/engines_util/random.hpp +++ b/src/tests/engines_util/random.hpp @@ -10,6 +10,7 @@ #include "execute_tools.hpp" #include "ngraph/runtime/tensor.hpp" #include "ngraph/type/element_type.hpp" +#include "ngraph/util.hpp" namespace ngraph { namespace test { diff --git a/src/tests/functional/inference_engine/ir_serialization/partial_shape_deserialization.cpp b/src/tests/functional/inference_engine/ir_serialization/partial_shape_deserialization.cpp index be0cbaf03d8..a51e55ad3aa 100644 --- a/src/tests/functional/inference_engine/ir_serialization/partial_shape_deserialization.cpp +++ b/src/tests/functional/inference_engine/ir_serialization/partial_shape_deserialization.cpp @@ -9,7 +9,7 @@ #include #include "openvino/frontend/manager.hpp" -#include "graph_comparator.hpp" +#include "common_test_utils/graph_comparator.hpp" #include "ie_blob.h" #include "ngraph/op/parameter.hpp" #include "ngraph/type/element_type.hpp" diff --git a/src/tests/functional/inference_engine/ir_serialization/rt_info_deserialization.cpp b/src/tests/functional/inference_engine/ir_serialization/rt_info_deserialization.cpp index 0f614ae60e7..6902ee30b47 100644 --- a/src/tests/functional/inference_engine/ir_serialization/rt_info_deserialization.cpp +++ b/src/tests/functional/inference_engine/ir_serialization/rt_info_deserialization.cpp @@ -16,7 +16,7 @@ #include #include #include "openvino/frontend/manager.hpp" -#include "graph_comparator.hpp" +#include "common_test_utils/graph_comparator.hpp" #include "ie_blob.h" #include "ie_precision.hpp" #include "ngraph/node.hpp" diff --git a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp index 4afc336f35f..0e2d0d1f115 100644 --- a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp +++ b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp @@ -13,7 +13,7 @@ #include "openvino/core/preprocess/pre_post_process.hpp" #include "openvino/pass/serialize.hpp" -#include "graph_comparator.hpp" +#include "common_test_utils/graph_comparator.hpp" #include "ngraph_functions/utils/ngraph_helpers.hpp" diff --git a/src/tests/ie_test_utils/common_test_utils/CMakeLists.txt b/src/tests/ie_test_utils/common_test_utils/CMakeLists.txt index 4cb38f5fe6e..c4a7e2dfe92 100644 --- a/src/tests/ie_test_utils/common_test_utils/CMakeLists.txt +++ b/src/tests/ie_test_utils/common_test_utils/CMakeLists.txt @@ -17,7 +17,6 @@ function(add_common_utils ADD_TARGET_NAME) PUBLIC gtest gtest_main - ngraph_test_util ngraphFunctions openvino::runtime openvino::runtime::dev diff --git a/src/tests/util/graph_comparator.cpp b/src/tests/ie_test_utils/common_test_utils/graph_comparator.cpp similarity index 100% rename from src/tests/util/graph_comparator.cpp rename to src/tests/ie_test_utils/common_test_utils/graph_comparator.cpp diff --git a/src/tests/util/graph_comparator.hpp b/src/tests/ie_test_utils/common_test_utils/graph_comparator.hpp similarity index 100% rename from src/tests/util/graph_comparator.hpp rename to src/tests/ie_test_utils/common_test_utils/graph_comparator.hpp diff --git a/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp b/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp index 9c6dd8250ce..549ada20f7f 100644 --- a/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp +++ b/src/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp @@ -23,7 +23,6 @@ #include "test_common.hpp" #include "graph_comparator.hpp" -#include "test_tools.hpp" #define DYN ngraph::Dimension::dynamic() @@ -95,3 +94,15 @@ private: void init_unique_names(std::shared_ptr f, const std::shared_ptr& unh); void check_unique_names(std::shared_ptr f, const std::shared_ptr& unh); + +template +size_t count_ops_of_type(const std::shared_ptr& f) { + size_t count = 0; + for (auto op : f->get_ops()) { + if (ngraph::is_type(op)) { + count++; + } + } + + return count; +} \ No newline at end of file diff --git a/src/tests/util/test_tools.hpp b/src/tests/util/test_tools.hpp index 0b04e7c65a1..323ed3053cb 100644 --- a/src/tests/util/test_tools.hpp +++ b/src/tests/util/test_tools.hpp @@ -16,18 +16,6 @@ #include "gtest/gtest.h" #include "ngraph/function.hpp" -template -size_t count_ops_of_type(const std::shared_ptr& f) { - size_t count = 0; - for (auto op : f->get_ops()) { - if (ngraph::is_type(op)) { - count++; - } - } - - return count; -} - /// \brief Reads a binary file to a vector. /// /// \param[in] path The path where the file is located.