From 10af23a90c6ca966e578074c9cdaee403c29d4f2 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Thu, 24 Jun 2021 02:52:04 +0300 Subject: [PATCH] Migrated nGraph tests to common gtest (#6314) --- ngraph/CMakeLists.txt | 8 - ngraph/cmake/external_gtest.cmake | 78 ---- ngraph/test/CMakeLists.txt | 8 - ngraph/test/all_close_f.cpp | 38 +- ngraph/test/backend/concat.in.cpp | 8 +- ngraph/test/backend/pad.in.cpp | 374 +++++++++--------- ngraph/test/backend/topk.in.cpp | 6 +- ngraph/test/onnx/onnx_test_utils.in.cpp | 17 +- ngraph/test/reshape_opt_kernel.cpp | 328 +++++++-------- ngraph/test/type_prop/abs.cpp | 2 +- ngraph/test/type_prop/acos.cpp | 2 +- ngraph/test/type_prop/arithmetic_ops.hpp | 69 ++-- ngraph/test/type_prop/asin.cpp | 2 +- ngraph/test/type_prop/batch_norm.cpp | 217 ++++------ ngraph/test/type_prop/broadcast.cpp | 64 +-- ngraph/test/type_prop/ceiling.cpp | 2 +- ngraph/test/type_prop/convolution.cpp | 88 ++--- ngraph/test/type_prop/dft.cpp | 12 +- ngraph/test/type_prop/divide.cpp | 2 +- ngraph/test/type_prop/exp.cpp | 2 +- ...imental_detectron_prior_grid_generator.cpp | 2 +- ...mental_detectron_roi_feature_extractor.cpp | 4 +- ngraph/test/type_prop/floor.cpp | 2 +- ngraph/test/type_prop/floor_mod.cpp | 2 +- ngraph/test/type_prop/idft.cpp | 12 +- ngraph/test/type_prop/maximum.cpp | 2 +- ngraph/test/type_prop/minimum.cpp | 2 +- ngraph/test/type_prop/mod.cpp | 2 +- ngraph/test/type_prop/multiply.cpp | 2 +- ngraph/test/type_prop/negative.cpp | 2 +- ngraph/test/type_prop/power.cpp | 2 +- ngraph/test/type_prop/range.cpp | 92 ++--- ngraph/test/type_prop/reduce_l1.cpp | 4 +- ngraph/test/type_prop/reduce_l2.cpp | 4 +- ngraph/test/type_prop/reduce_logical_and.cpp | 4 +- ngraph/test/type_prop/reduce_logical_or.cpp | 4 +- ngraph/test/type_prop/reduce_max.cpp | 4 +- ngraph/test/type_prop/reduce_mean.cpp | 4 +- ngraph/test/type_prop/reduce_min.cpp | 4 +- ngraph/test/type_prop/reduce_ops.hpp | 56 ++- ngraph/test/type_prop/reduce_prod.cpp | 4 +- ngraph/test/type_prop/reduce_sum.cpp | 4 +- ngraph/test/type_prop/select.cpp | 2 +- ngraph/test/type_prop/sin.cpp | 2 +- ngraph/test/type_prop/sqrt.cpp | 2 +- ngraph/test/type_prop/squared_difference.cpp | 2 +- ngraph/test/type_prop/subtract.cpp | 2 +- ngraph/test/type_prop/top_k.cpp | 16 +- ngraph/test/type_prop/unary_ops.hpp | 24 +- ngraph/test/util/CMakeLists.txt | 2 +- ngraph/test/util/test_control.hpp | 48 +-- ngraph/test/visitors/op/batch_norm.cpp | 10 +- ngraph/test/visitors/op/ceiling.cpp | 8 +- ngraph/test/visitors/op/floor.cpp | 8 +- ngraph/test/visitors/op/log.cpp | 8 +- ngraph/test/visitors/op/negative.cpp | 8 +- ngraph/test/visitors/op/reduce_l1.cpp | 2 +- ngraph/test/visitors/op/reduce_l2.cpp | 2 +- .../test/visitors/op/reduce_logical_and.cpp | 2 +- ngraph/test/visitors/op/reduce_logical_or.cpp | 2 +- ngraph/test/visitors/op/reduce_max.cpp | 2 +- ngraph/test/visitors/op/reduce_mean.cpp | 2 +- ngraph/test/visitors/op/reduce_min.cpp | 2 +- ngraph/test/visitors/op/reduce_ops.hpp | 8 +- ngraph/test/visitors/op/reduce_prod.cpp | 2 +- ngraph/test/visitors/op/reduce_sum.cpp | 2 +- ngraph/test/visitors/op/result.cpp | 8 +- ngraph/test/visitors/op/softplus.cpp | 8 +- ngraph/test/visitors/op/sqrt.cpp | 8 +- ngraph/test/visitors/op/squeeze.cpp | 10 +- ngraph/test/visitors/op/swish.cpp | 8 +- ngraph/test/visitors/op/unary_ops.hpp | 4 +- 72 files changed, 802 insertions(+), 957 deletions(-) delete mode 100644 ngraph/cmake/external_gtest.cmake diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt index 4c598cf7b84..1bd9dba71bb 100644 --- a/ngraph/CMakeLists.txt +++ b/ngraph/CMakeLists.txt @@ -328,14 +328,6 @@ endif() add_subdirectory(frontend) -if(NGRAPH_UNIT_TEST_ENABLE) - set(BEFORE_GTEST_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) - set(BUILD_SHARED_LIBS OFF) - include(cmake/external_gtest.cmake) - set(BUILD_SHARED_LIBS ${BEFORE_GTEST_BUILD_SHARED_LIBS}) - unset(BEFORE_GTEST_BUILD_SHARED_LIBS) -endif() - add_subdirectory(test) if (NGRAPH_PYTHON_BUILD_ENABLE) diff --git a/ngraph/cmake/external_gtest.cmake b/ngraph/cmake/external_gtest.cmake deleted file mode 100644 index 529d577cdd9..00000000000 --- a/ngraph/cmake/external_gtest.cmake +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2018-2021 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -# Enable ExternalProject CMake module -include(ExternalProject) - -#------------------------------------------------------------------------------ -# Download and install GoogleTest ... -#------------------------------------------------------------------------------ - -SET(GTEST_GIT_REPO_URL https://github.com/google/googletest.git) -SET(GTEST_GIT_LABEL release-1.8.1) - -set(GMOCK_OUTPUT_DIR ${EXTERNAL_PROJECTS_ROOT}/gtest/build/googlemock) -set(GTEST_OUTPUT_DIR ${GMOCK_OUTPUT_DIR}/gtest) - -if(WIN32) - list(APPEND GTEST_CMAKE_ARGS - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=${GTEST_OUTPUT_DIR} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO=${GTEST_OUTPUT_DIR} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${GTEST_OUTPUT_DIR} - -Dgtest_force_shared_crt=TRUE - ) - set(GMOCK_OUTPUT_DIR ${GTEST_OUTPUT_DIR}) -endif() - -if(CMAKE_BUILD_TYPE) - list(APPEND GTEST_CMAKE_ARGS - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - ) -endif() - -# Build for ninja -SET(GTEST_PATHS ${GTEST_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX} - ${GMOCK_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gmockd${CMAKE_STATIC_LIBRARY_SUFFIX} - ${GTEST_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${GMOCK_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}) - -ExternalProject_Add( - ext_gtest - PREFIX gtest - GIT_REPOSITORY ${GTEST_GIT_REPO_URL} - GIT_TAG ${GTEST_GIT_LABEL} - # Disable install step - INSTALL_COMMAND "" - UPDATE_COMMAND "" - CMAKE_GENERATOR ${CMAKE_GENERATOR} - CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM} - CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET} - CMAKE_ARGS - ${NGRAPH_FORWARD_CMAKE_ARGS} - -DCMAKE_CXX_FLAGS=${GTEST_CXX_FLAGS} - ${GTEST_CMAKE_ARGS} - BINARY_DIR "${EXTERNAL_PROJECTS_ROOT}/gtest/build" - EXCLUDE_FROM_ALL TRUE - BUILD_BYPRODUCTS ${GTEST_PATHS} - ) - -#------------------------------------------------------------------------------ - -ExternalProject_Get_Property(ext_gtest SOURCE_DIR BINARY_DIR) - -add_library(libgtest INTERFACE) -add_dependencies(libgtest ext_gtest ext_gmock) -target_include_directories(libgtest SYSTEM INTERFACE - ${SOURCE_DIR}/googletest/include - ${SOURCE_DIR}/googlemock/include) - -if(LINUX OR APPLE OR WIN32) - target_link_libraries(libgtest INTERFACE - debug ${GTEST_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtestd${CMAKE_STATIC_LIBRARY_SUFFIX} - debug ${GMOCK_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gmockd${CMAKE_STATIC_LIBRARY_SUFFIX} - optimized ${GTEST_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - optimized ${GMOCK_OUTPUT_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}) -else() - message(FATAL_ERROR "libgtest: Unsupported platform.") -endif() diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index df92b547132..ee71d789fa6 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -18,14 +18,6 @@ if(LINUX) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.0.0") - # gtest has issues with this with v1.8.x - # gtest issue is supposed to be addressed after v1.8.x - add_compile_options(-Wno-zero-as-null-pointer-constant) - endif() -endif() - set(SRC aligned_buffer.cpp all_close_f.cpp diff --git a/ngraph/test/all_close_f.cpp b/ngraph/test/all_close_f.cpp index 7e0a1425c3b..26e18cd8afd 100644 --- a/ngraph/test/all_close_f.cpp +++ b/ngraph/test/all_close_f.cpp @@ -158,23 +158,23 @@ TEST_P(all_close_f_param_test, test_boundaries) << ss.str(); } -INSTANTIATE_TEST_CASE_P(test_simple_floats_with_range_of_precisions, - all_close_f_param_test, - testing::Combine(testing::Values(0.f, - -0.f, - 1.f, - -1.f, - 10.f, - -10.f, - 0.75f, - -0.75f, - 0.5f, - -0.5f, - 0.25f, - -0.25f, - 0.125f, - -0.125f), - testing::Range(0, 5)), ); +INSTANTIATE_TEST_SUITE_P(test_simple_floats_with_range_of_precisions, + all_close_f_param_test, + testing::Combine(testing::Values(0.f, + -0.f, + 1.f, + -1.f, + 10.f, + -10.f, + 0.75f, + -0.75f, + 0.5f, + -0.5f, + 0.25f, + -0.25f, + 0.125f, + -0.125f), + testing::Range(0, 5))); class all_close_f_double_param_test : public testing::TestWithParam<::std::tuple> { @@ -315,13 +315,13 @@ TEST_P(all_close_f_double_param_test, test_boundaries) << ss.str(); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( test_simple_doubles_with_range_of_precisions, all_close_f_double_param_test, testing::Combine( testing::Values( 0., -0., 1., -1., 10., -10., 0.75, -0.75, 0.5, -0.5, 0.25, -0.25, 0.125, -0.125), - testing::Range(0, 17)), ); + testing::Range(0, 17))); // Test the exact bounds near +0.f // diff --git a/ngraph/test/backend/concat.in.cpp b/ngraph/test/backend/concat.in.cpp index 11db391c2a9..d0383c42de9 100644 --- a/ngraph/test/backend/concat.in.cpp +++ b/ngraph/test/backend/concat.in.cpp @@ -185,10 +185,10 @@ NGRAPH_TEST_P(${BACKEND_NAME}, concat_vector_params, concat_vector_large) // Add thhosw tests to cover paramter space overflow: // cuda kernel parameter space have limit, if there is large number of parameters, // there will be overflow for parameter space. -NGRAPH_INSTANTIATE_TEST_CASE_P(${BACKEND_NAME}, - input_sizes, - concat_vector_params, - testing::Values(100, 128, 999)); +NGRAPH_INSTANTIATE_TEST_SUITE_P(${BACKEND_NAME}, + input_sizes, + concat_vector_params, + testing::Values(100, 128, 999)); NGRAPH_TEST(${BACKEND_NAME}, concat_vector) { diff --git a/ngraph/test/backend/pad.in.cpp b/ngraph/test/backend/pad.in.cpp index 3fe822da871..e4e5780923f 100644 --- a/ngraph/test/backend/pad.in.cpp +++ b/ngraph/test/backend/pad.in.cpp @@ -110,14 +110,14 @@ namespace MIN_FLOAT_TOLERANCE_BITS)); } }; -} +} // namespace NGRAPH_TEST_P(${BACKEND_NAME}, PadBackendTest, PadBackendTestForSpec) { execute_test(GetParam()); } -NGRAPH_INSTANTIATE_TEST_CASE_P( +NGRAPH_INSTANTIATE_TEST_SUITE_P( ${BACKEND_NAME}, pad_1d_constant_const_value_provided, PadBackendTest, @@ -142,7 +142,7 @@ NGRAPH_INSTANTIATE_TEST_CASE_P( op::PadMode::CONSTANT, 2112})); -NGRAPH_INSTANTIATE_TEST_CASE_P( +NGRAPH_INSTANTIATE_TEST_SUITE_P( ${BACKEND_NAME}, pad_1d_constant_use_default_const, PadBackendTest, @@ -163,7 +163,7 @@ NGRAPH_INSTANTIATE_TEST_CASE_P( test::NDArray({1, 2, 3, 4, 5, 6, 0, 0, 0}), op::PadMode::CONSTANT})); -NGRAPH_INSTANTIATE_TEST_CASE_P( +NGRAPH_INSTANTIATE_TEST_SUITE_P( ${BACKEND_NAME}, pad_2d_constant_const_value_provided, PadBackendTest, @@ -210,50 +210,50 @@ NGRAPH_INSTANTIATE_TEST_CASE_P( op::PadMode::CONSTANT, 2112})); -NGRAPH_INSTANTIATE_TEST_CASE_P(${BACKEND_NAME}, - pad_2d_constant_use_default_const, - PadBackendTest, - testing::Values(Params{test::NDArray({ - {1, 2}, - {3, 4}, - }), - test::NDArray({1, 2}), - test::NDArray({3, 4}), - test::NDArray({ - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 1, 2, 0, 0, 0, 0}, - {0, 0, 3, 4, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - }), - op::PadMode::CONSTANT}, - Params{test::NDArray({ - {1, 2}, - {3, 4}, - }), - test::NDArray({1, 2}), - test::NDArray({0, 0}), - test::NDArray({ - {0, 0, 0, 0}, - {0, 0, 1, 2}, - {0, 0, 3, 4}, - }), - op::PadMode::CONSTANT}, - Params{test::NDArray({ - {1, 2}, - {3, 4}, - }), - test::NDArray({0, 0}), - test::NDArray({1, 2}), - test::NDArray({ - {1, 2, 0, 0}, - {3, 4, 0, 0}, - {0, 0, 0, 0}, - }), - op::PadMode::CONSTANT})); +NGRAPH_INSTANTIATE_TEST_SUITE_P(${BACKEND_NAME}, + pad_2d_constant_use_default_const, + PadBackendTest, + testing::Values(Params{test::NDArray({ + {1, 2}, + {3, 4}, + }), + test::NDArray({1, 2}), + test::NDArray({3, 4}), + test::NDArray({ + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 2, 0, 0, 0, 0}, + {0, 0, 3, 4, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + }), + op::PadMode::CONSTANT}, + Params{test::NDArray({ + {1, 2}, + {3, 4}, + }), + test::NDArray({1, 2}), + test::NDArray({0, 0}), + test::NDArray({ + {0, 0, 0, 0}, + {0, 0, 1, 2}, + {0, 0, 3, 4}, + }), + op::PadMode::CONSTANT}, + Params{test::NDArray({ + {1, 2}, + {3, 4}, + }), + test::NDArray({0, 0}), + test::NDArray({1, 2}), + test::NDArray({ + {1, 2, 0, 0}, + {3, 4, 0, 0}, + {0, 0, 0, 0}, + }), + op::PadMode::CONSTANT})); -NGRAPH_INSTANTIATE_TEST_CASE_P( +NGRAPH_INSTANTIATE_TEST_SUITE_P( ${BACKEND_NAME}, pad_1d_edge, PadBackendTest, @@ -273,50 +273,50 @@ NGRAPH_INSTANTIATE_TEST_CASE_P( test::NDArray({1, 2, 3, 4, 5, 6, 6, 6}), op::PadMode::EDGE})); -NGRAPH_INSTANTIATE_TEST_CASE_P(${BACKEND_NAME}, - pad_2d_edge, - PadBackendTest, - testing::Values(Params{test::NDArray({ - {1, 2}, - {3, 4}, - }), - test::NDArray({1, 2}), - test::NDArray({2, 1}), - test::NDArray({ - {1, 1, 1, 2, 2}, - {1, 1, 1, 2, 2}, - {3, 3, 3, 4, 4}, - {3, 3, 3, 4, 4}, - {3, 3, 3, 4, 4}, - }), - op::PadMode::EDGE}, - Params{test::NDArray({ - {1, 2}, - {3, 4}, - }), - test::NDArray({1, 2}), - test::NDArray({0, 0}), - test::NDArray({ - {1, 1, 1, 2}, - {1, 1, 1, 2}, - {3, 3, 3, 4}, - }), - op::PadMode::EDGE}, - Params{test::NDArray({ - {1, 2}, - {3, 4}, - }), - test::NDArray({0, 0}), - test::NDArray({2, 1}), - test::NDArray({ - {1, 2, 2}, - {3, 4, 4}, - {3, 4, 4}, - {3, 4, 4}, - }), - op::PadMode::EDGE})); +NGRAPH_INSTANTIATE_TEST_SUITE_P(${BACKEND_NAME}, + pad_2d_edge, + PadBackendTest, + testing::Values(Params{test::NDArray({ + {1, 2}, + {3, 4}, + }), + test::NDArray({1, 2}), + test::NDArray({2, 1}), + test::NDArray({ + {1, 1, 1, 2, 2}, + {1, 1, 1, 2, 2}, + {3, 3, 3, 4, 4}, + {3, 3, 3, 4, 4}, + {3, 3, 3, 4, 4}, + }), + op::PadMode::EDGE}, + Params{test::NDArray({ + {1, 2}, + {3, 4}, + }), + test::NDArray({1, 2}), + test::NDArray({0, 0}), + test::NDArray({ + {1, 1, 1, 2}, + {1, 1, 1, 2}, + {3, 3, 3, 4}, + }), + op::PadMode::EDGE}, + Params{test::NDArray({ + {1, 2}, + {3, 4}, + }), + test::NDArray({0, 0}), + test::NDArray({2, 1}), + test::NDArray({ + {1, 2, 2}, + {3, 4, 4}, + {3, 4, 4}, + {3, 4, 4}, + }), + op::PadMode::EDGE})); -NGRAPH_INSTANTIATE_TEST_CASE_P( +NGRAPH_INSTANTIATE_TEST_SUITE_P( ${BACKEND_NAME}, pad_1d_reflect, PadBackendTest, @@ -336,56 +336,56 @@ NGRAPH_INSTANTIATE_TEST_CASE_P( test::NDArray({1, 2, 3, 4, 5, 6, 5, 4}), op::PadMode::REFLECT})); -NGRAPH_INSTANTIATE_TEST_CASE_P(${BACKEND_NAME}, - pad_2d_reflect, - PadBackendTest, - testing::Values(Params{test::NDArray({ - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}, - }), - test::NDArray({1, 2}), - test::NDArray({2, 1}), - test::NDArray({ - {6, 5, 4, 5, 6, 5}, - {3, 2, 1, 2, 3, 2}, - {6, 5, 4, 5, 6, 5}, - {9, 8, 7, 8, 9, 8}, - {6, 5, 4, 5, 6, 5}, - {3, 2, 1, 2, 3, 2}, - }), - op::PadMode::REFLECT}, - Params{test::NDArray({ - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}, - }), - test::NDArray({1, 2}), - test::NDArray({0, 0}), - test::NDArray({ - {6, 5, 4, 5, 6}, - {3, 2, 1, 2, 3}, - {6, 5, 4, 5, 6}, - {9, 8, 7, 8, 9}, - }), - op::PadMode::REFLECT}, - Params{test::NDArray({ - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}, - }), - test::NDArray({0, 0}), - test::NDArray({2, 1}), - test::NDArray({ - {1, 2, 3, 2}, - {4, 5, 6, 5}, - {7, 8, 9, 8}, - {4, 5, 6, 5}, - {1, 2, 3, 2}, - }), - op::PadMode::REFLECT})); +NGRAPH_INSTANTIATE_TEST_SUITE_P(${BACKEND_NAME}, + pad_2d_reflect, + PadBackendTest, + testing::Values(Params{test::NDArray({ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }), + test::NDArray({1, 2}), + test::NDArray({2, 1}), + test::NDArray({ + {6, 5, 4, 5, 6, 5}, + {3, 2, 1, 2, 3, 2}, + {6, 5, 4, 5, 6, 5}, + {9, 8, 7, 8, 9, 8}, + {6, 5, 4, 5, 6, 5}, + {3, 2, 1, 2, 3, 2}, + }), + op::PadMode::REFLECT}, + Params{test::NDArray({ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }), + test::NDArray({1, 2}), + test::NDArray({0, 0}), + test::NDArray({ + {6, 5, 4, 5, 6}, + {3, 2, 1, 2, 3}, + {6, 5, 4, 5, 6}, + {9, 8, 7, 8, 9}, + }), + op::PadMode::REFLECT}, + Params{test::NDArray({ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }), + test::NDArray({0, 0}), + test::NDArray({2, 1}), + test::NDArray({ + {1, 2, 3, 2}, + {4, 5, 6, 5}, + {7, 8, 9, 8}, + {4, 5, 6, 5}, + {1, 2, 3, 2}, + }), + op::PadMode::REFLECT})); -NGRAPH_INSTANTIATE_TEST_CASE_P( +NGRAPH_INSTANTIATE_TEST_SUITE_P( ${BACKEND_NAME}, pad_1d_symmetric, PadBackendTest, @@ -405,55 +405,55 @@ NGRAPH_INSTANTIATE_TEST_CASE_P( test::NDArray({1, 2, 3, 4, 5, 6, 6, 5}), op::PadMode::SYMMETRIC})); -NGRAPH_INSTANTIATE_TEST_CASE_P(${BACKEND_NAME}, - pad_2d_symmetric, - PadBackendTest, - testing::Values(Params{test::NDArray({ - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}, - }), - test::NDArray({1, 2}), - test::NDArray({2, 1}), - test::NDArray({ - {2, 1, 1, 2, 3, 3}, - {2, 1, 1, 2, 3, 3}, - {5, 4, 4, 5, 6, 6}, - {8, 7, 7, 8, 9, 9}, - {8, 7, 7, 8, 9, 9}, - {5, 4, 4, 5, 6, 6}, - }), - op::PadMode::SYMMETRIC}, - Params{test::NDArray({ - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}, - }), - test::NDArray({1, 2}), - test::NDArray({0, 0}), - test::NDArray({ - {2, 1, 1, 2, 3}, - {2, 1, 1, 2, 3}, - {5, 4, 4, 5, 6}, - {8, 7, 7, 8, 9}, +NGRAPH_INSTANTIATE_TEST_SUITE_P(${BACKEND_NAME}, + pad_2d_symmetric, + PadBackendTest, + testing::Values(Params{test::NDArray({ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }), + test::NDArray({1, 2}), + test::NDArray({2, 1}), + test::NDArray({ + {2, 1, 1, 2, 3, 3}, + {2, 1, 1, 2, 3, 3}, + {5, 4, 4, 5, 6, 6}, + {8, 7, 7, 8, 9, 9}, + {8, 7, 7, 8, 9, 9}, + {5, 4, 4, 5, 6, 6}, + }), + op::PadMode::SYMMETRIC}, + Params{test::NDArray({ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }), + test::NDArray({1, 2}), + test::NDArray({0, 0}), + test::NDArray({ + {2, 1, 1, 2, 3}, + {2, 1, 1, 2, 3}, + {5, 4, 4, 5, 6}, + {8, 7, 7, 8, 9}, - }), - op::PadMode::SYMMETRIC}, - Params{test::NDArray({ - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}, - }), - test::NDArray({0, 0}), - test::NDArray({2, 1}), - test::NDArray({ - {1, 2, 3, 3}, - {4, 5, 6, 6}, - {7, 8, 9, 9}, - {7, 8, 9, 9}, - {4, 5, 6, 6}, - }), - op::PadMode::SYMMETRIC})); + }), + op::PadMode::SYMMETRIC}, + Params{test::NDArray({ + {1, 2, 3}, + {4, 5, 6}, + {7, 8, 9}, + }), + test::NDArray({0, 0}), + test::NDArray({2, 1}), + test::NDArray({ + {1, 2, 3, 3}, + {4, 5, 6, 6}, + {7, 8, 9, 9}, + {7, 8, 9, 9}, + {4, 5, 6, 6}, + }), + op::PadMode::SYMMETRIC})); NGRAPH_TEST(${BACKEND_NAME}, pad_to_large_symmetric_padding) { diff --git a/ngraph/test/backend/topk.in.cpp b/ngraph/test/backend/topk.in.cpp index 902fae9bd39..e589e37a644 100644 --- a/ngraph/test/backend/topk.in.cpp +++ b/ngraph/test/backend/topk.in.cpp @@ -1261,7 +1261,7 @@ template class topk_backend : public ::testing::Test { }; -TYPED_TEST_CASE_P(topk_backend); +TYPED_TEST_SUITE_P(topk_backend); template struct TopkSortTestOutputs @@ -1323,7 +1323,7 @@ TYPED_TEST_P(topk_backend, topk_mode_sort_order) } } -REGISTER_TYPED_TEST_CASE_P(topk_backend, topk_mode_sort_order); +REGISTER_TYPED_TEST_SUITE_P(topk_backend, topk_mode_sort_order); typedef ::testing::Types TopKTypes; -INSTANTIATE_TYPED_TEST_CASE_P(${BACKEND_NAME}, topk_backend, TopKTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(${BACKEND_NAME}, topk_backend, TopKTypes); diff --git a/ngraph/test/onnx/onnx_test_utils.in.cpp b/ngraph/test/onnx/onnx_test_utils.in.cpp index 01019823b2b..d9fe105e98d 100644 --- a/ngraph/test/onnx/onnx_test_utils.in.cpp +++ b/ngraph/test/onnx/onnx_test_utils.in.cpp @@ -29,7 +29,7 @@ template class ElemTypesTests : public ::testing::Test { }; -TYPED_TEST_CASE_P(ElemTypesTests); +TYPED_TEST_SUITE_P(ElemTypesTests); TYPED_TEST_P(ElemTypesTests, onnx_test_add_abc_set_precission) { @@ -69,14 +69,14 @@ TYPED_TEST_P(ElemTypesTests, onnx_test_split_multioutput_set_precission) test_case.run(); } -REGISTER_TYPED_TEST_CASE_P(ElemTypesTests, - onnx_test_add_abc_set_precission, - onnx_test_split_multioutput_set_precission); +REGISTER_TYPED_TEST_SUITE_P(ElemTypesTests, + onnx_test_add_abc_set_precission, + onnx_test_split_multioutput_set_precission); typedef ::testing::Types ElemTypes; -INSTANTIATE_TYPED_TEST_CASE_P(${BACKEND_NAME}, ElemTypesTests, ElemTypes); +INSTANTIATE_TYPED_TEST_SUITE_P(${BACKEND_NAME}, ElemTypesTests, ElemTypes); - -NGRAPH_TEST(${BACKEND_NAME}, add_abc_from_ir) { +NGRAPH_TEST(${BACKEND_NAME}, add_abc_from_ir) +{ const auto ir_xml = file_util::path_join(SERIALIZED_ZOO, "ir/add_abc.xml"); const auto function = test::function_from_ir(ir_xml); @@ -89,7 +89,8 @@ NGRAPH_TEST(${BACKEND_NAME}, add_abc_from_ir) { test_case.run(); } -NGRAPH_TEST(${BACKEND_NAME}, add_abc_from_ir_with_bin_path) { +NGRAPH_TEST(${BACKEND_NAME}, add_abc_from_ir_with_bin_path) +{ const auto ir_xml = file_util::path_join(SERIALIZED_ZOO, "ir/add_abc.xml"); const auto ir_bin = file_util::path_join(SERIALIZED_ZOO, "ir/weights/add_abc.bin"); const auto function = test::function_from_ir(ir_xml, ir_bin); diff --git a/ngraph/test/reshape_opt_kernel.cpp b/ngraph/test/reshape_opt_kernel.cpp index 01a2358e29e..8d50d2080a8 100644 --- a/ngraph/test/reshape_opt_kernel.cpp +++ b/ngraph/test/reshape_opt_kernel.cpp @@ -64,169 +64,169 @@ TEST_P(ReshapeOptKernel, reshape_opt_kernel) EXPECT_EQ(p.output.get_vector(), output_buff); } -INSTANTIATE_TEST_CASE_P(reshape_opt_kernel, - ReshapeOptKernel, - ::testing::Values(TestParams{AxisOrder::straight, - test::NDArray{ - {1, 2}, - {3, 4}, - {5, 6}, - }, - test::NDArray{ - {1, 2, 3}, - {4, 5, 6}, - }}, - TestParams{AxisOrder::straight, - test::NDArray{ - {1, 2}, - {3, 4}, - {5, 6}, - }, - test::NDArray{ - {1, 2, 3, 4, 5, 6}, - }}, - TestParams{AxisOrder::straight, - test::NDArray{ - { - {11, 12}, - {13, 14}, - {15, 16}, - }, - { - {21, 22}, - {23, 24}, - {25, 26}, - }, - }, - test::NDArray{ - {11, 12, 13, 14, 15, 16}, - {21, 22, 23, 24, 25, 26}, - }}, - TestParams{AxisOrder::straight, - test::NDArray{ - { - { - {11, 12}, - {13, 14}, - {15, 16}, - }, - { - {21, 22}, - {23, 24}, - {25, 26}, - }, - }, - }, - test::NDArray{ - {11, 12, 13, 14, 15, 16}, - {21, 22, 23, 24, 25, 26}, - }}, - TestParams{AxisOrder::reverse, - test::NDArray{ - {1, 2}, - {3, 4}, - {5, 6}, - }, - test::NDArray{ - {1, 3, 5}, - {2, 4, 6}, - }}, - TestParams{AxisOrder::reverse, - test::NDArray{ - {1, 2}, - {3, 4}, - {5, 6}, - }, - test::NDArray{ - {1, 3, 5, 2, 4, 6}, - }}, - TestParams{AxisOrder::reverse, - test::NDArray{ - { - {11, 12}, - {13, 14}, - {15, 16}, - }, - { - {21, 22}, - {23, 24}, - {25, 26}, - }, - }, - test::NDArray{ - {11, 21, 13, 23, 15, 25}, - {12, 22, 14, 24, 16, 26}, - }}, - TestParams{AxisOrder::reverse, - test::NDArray{ - { - { - {11, 12}, - {13, 14}, - {15, 16}, - }, - { - {21, 22}, - {23, 24}, - {25, 26}, - }, - }, - }, - test::NDArray{ - {11, 21, 13, 23, 15, 25}, - {12, 22, 14, 24, 16, 26}, - }})); +INSTANTIATE_TEST_SUITE_P(reshape_opt_kernel, + ReshapeOptKernel, + ::testing::Values(TestParams{AxisOrder::straight, + test::NDArray{ + {1, 2}, + {3, 4}, + {5, 6}, + }, + test::NDArray{ + {1, 2, 3}, + {4, 5, 6}, + }}, + TestParams{AxisOrder::straight, + test::NDArray{ + {1, 2}, + {3, 4}, + {5, 6}, + }, + test::NDArray{ + {1, 2, 3, 4, 5, 6}, + }}, + TestParams{AxisOrder::straight, + test::NDArray{ + { + {11, 12}, + {13, 14}, + {15, 16}, + }, + { + {21, 22}, + {23, 24}, + {25, 26}, + }, + }, + test::NDArray{ + {11, 12, 13, 14, 15, 16}, + {21, 22, 23, 24, 25, 26}, + }}, + TestParams{AxisOrder::straight, + test::NDArray{ + { + { + {11, 12}, + {13, 14}, + {15, 16}, + }, + { + {21, 22}, + {23, 24}, + {25, 26}, + }, + }, + }, + test::NDArray{ + {11, 12, 13, 14, 15, 16}, + {21, 22, 23, 24, 25, 26}, + }}, + TestParams{AxisOrder::reverse, + test::NDArray{ + {1, 2}, + {3, 4}, + {5, 6}, + }, + test::NDArray{ + {1, 3, 5}, + {2, 4, 6}, + }}, + TestParams{AxisOrder::reverse, + test::NDArray{ + {1, 2}, + {3, 4}, + {5, 6}, + }, + test::NDArray{ + {1, 3, 5, 2, 4, 6}, + }}, + TestParams{AxisOrder::reverse, + test::NDArray{ + { + {11, 12}, + {13, 14}, + {15, 16}, + }, + { + {21, 22}, + {23, 24}, + {25, 26}, + }, + }, + test::NDArray{ + {11, 21, 13, 23, 15, 25}, + {12, 22, 14, 24, 16, 26}, + }}, + TestParams{AxisOrder::reverse, + test::NDArray{ + { + { + {11, 12}, + {13, 14}, + {15, 16}, + }, + { + {21, 22}, + {23, 24}, + {25, 26}, + }, + }, + }, + test::NDArray{ + {11, 21, 13, 23, 15, 25}, + {12, 22, 14, 24, 16, 26}, + }})); // input shape with size > 6 should be covered by reference implementation: -INSTANTIATE_TEST_CASE_P(reshape_opt_kernel_ref_impl_fallback, - ReshapeOptKernel, - ::testing::Values(TestParams{AxisOrder::straight, - test::NDArray{ - { - { - { - { - { - {11, 12}, - {13, 14}, - {15, 16}, - }, - { - {21, 22}, - {23, 24}, - {25, 26}, - }, - }, - }, - }, - }, - }, - test::NDArray{ - {11, 12, 13, 14, 15, 16}, - {21, 22, 23, 24, 25, 26}, - }}, - TestParams{AxisOrder::reverse, - test::NDArray{ - { - { - { - { - { - {11, 12}, - {13, 14}, - {15, 16}, - }, - { - {21, 22}, - {23, 24}, - {25, 26}, - }, - }, - }, - }, - }, - }, - test::NDArray{ - {11, 21, 13, 23, 15, 25}, - {12, 22, 14, 24, 16, 26}, - }})); +INSTANTIATE_TEST_SUITE_P(reshape_opt_kernel_ref_impl_fallback, + ReshapeOptKernel, + ::testing::Values(TestParams{AxisOrder::straight, + test::NDArray{ + { + { + { + { + { + {11, 12}, + {13, 14}, + {15, 16}, + }, + { + {21, 22}, + {23, 24}, + {25, 26}, + }, + }, + }, + }, + }, + }, + test::NDArray{ + {11, 12, 13, 14, 15, 16}, + {21, 22, 23, 24, 25, 26}, + }}, + TestParams{AxisOrder::reverse, + test::NDArray{ + { + { + { + { + { + {11, 12}, + {13, 14}, + {15, 16}, + }, + { + {21, 22}, + {23, 24}, + {25, 26}, + }, + }, + }, + }, + }, + }, + test::NDArray{ + {11, 21, 13, 23, 15, 25}, + {12, 22, 14, 24, 16, 26}, + }})); diff --git a/ngraph/test/type_prop/abs.cpp b/ngraph/test/type_prop/abs.cpp index 7ef727bdee0..1ca09555f0b 100644 --- a/ngraph/test/type_prop/abs.cpp +++ b/ngraph/test/type_prop/abs.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_abs, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_abs, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/acos.cpp b/ngraph/test/type_prop/acos.cpp index 8bff6e06dd9..ef02132d7dc 100644 --- a/ngraph/test/type_prop/acos.cpp +++ b/ngraph/test/type_prop/acos.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_acos, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_acos, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/arithmetic_ops.hpp b/ngraph/test/type_prop/arithmetic_ops.hpp index 103982f9b1a..0bf98cd5793 100644 --- a/ngraph/test/type_prop/arithmetic_ops.hpp +++ b/ngraph/test/type_prop/arithmetic_ops.hpp @@ -24,14 +24,14 @@ class ArithmeticOperator : public testing::Test { }; -TYPED_TEST_CASE_P(ArithmeticOperator); +TYPED_TEST_SUITE_P(ArithmeticOperator); TYPED_TEST_P(ArithmeticOperator, shape_inference_2D) { auto A = std::make_shared(element::f32, Shape{2, 2}); auto B = std::make_shared(element::f32, Shape{2, 2}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{2, 2})); @@ -42,7 +42,7 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_4D) auto A = std::make_shared(element::f32, Shape{2, 2, 3, 3}); auto B = std::make_shared(element::f32, Shape{2, 2, 3, 3}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{2, 2, 3, 3})); @@ -53,7 +53,7 @@ TYPED_TEST_P(ArithmeticOperator, default_autobroadcast) auto A = std::make_shared(element::f32, Shape{2, 2}); auto B = std::make_shared(element::f32, Shape{2, 2}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{2, 2})); @@ -77,7 +77,7 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_4D_x_scalar_numpy_broadcast) auto A = std::make_shared(element::f32, Shape{2, 3, 4, 5}); auto B = std::make_shared(element::f32, Shape{1}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{2, 3, 4, 5})); @@ -88,7 +88,7 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_4D_x_1D_numpy_broadcast) auto A = std::make_shared(element::f32, Shape{2, 3, 4, 5}); auto B = std::make_shared(element::f32, Shape{5}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{2, 3, 4, 5})); @@ -99,7 +99,7 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_2D_x_4D_numpy_broadcast) auto A = std::make_shared(element::f32, Shape{4, 5}); auto B = std::make_shared(element::f32, Shape{2, 3, 4, 5}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{2, 3, 4, 5})); @@ -110,7 +110,7 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_3D_x_4D_numpy_broadcast) auto A = std::make_shared(element::f32, Shape{1, 4, 5}); auto B = std::make_shared(element::f32, Shape{2, 3, 1, 1}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{2, 3, 4, 5})); @@ -121,7 +121,7 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_4D_x_3D_numpy_broadcast) auto A = std::make_shared(element::f32, Shape{8, 1, 6, 1}); auto B = std::make_shared(element::f32, Shape{7, 1, 5}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_shape(), (Shape{8, 7, 6, 5})); @@ -174,7 +174,7 @@ TYPED_TEST_P(ArithmeticOperator, dynamic_shape_3D) auto A = std::make_shared(element::f32, PartialShape{dynamic, dynamic, 6}); auto B = std::make_shared(element::f32, PartialShape{dynamic, dynamic, 6}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); ASSERT_EQ(op->get_output_partial_shape(0), (PartialShape{dynamic, dynamic, 6})); @@ -183,16 +183,15 @@ TYPED_TEST_P(ArithmeticOperator, dynamic_shape_3D) TYPED_TEST_P(ArithmeticOperator, dynamic_shape_5D) { Dimension dynamic = Dimension::dynamic(); - auto A = - std::make_shared(element::f32, PartialShape{dynamic, 4, dynamic, dynamic, 6}); - auto B = - std::make_shared(element::f32, PartialShape{dynamic, 4, dynamic, dynamic, 6}); + auto A = std::make_shared(element::f32, + PartialShape{dynamic, 4, dynamic, dynamic, 6}); + auto B = std::make_shared(element::f32, + PartialShape{dynamic, 4, dynamic, dynamic, 6}); - const auto op = std::make_shared(A, B); + const auto op = std::make_shared(A, B); ASSERT_EQ(op->get_element_type(), element::f32); - ASSERT_EQ(op->get_output_partial_shape(0), - (PartialShape{dynamic, 4, dynamic, dynamic, 6})); + ASSERT_EQ(op->get_output_partial_shape(0), (PartialShape{dynamic, 4, dynamic, dynamic, 6})); } TYPED_TEST_P(ArithmeticOperator, full_dynamic_shape) @@ -203,21 +202,21 @@ TYPED_TEST_P(ArithmeticOperator, full_dynamic_shape) ASSERT_TRUE(op->get_output_partial_shape(0).same_scheme(PartialShape::dynamic())); } -REGISTER_TYPED_TEST_CASE_P(ArithmeticOperator, - shape_inference_2D, - shape_inference_4D, - default_autobroadcast, - no_autobroadcast, - shape_inference_4D_x_scalar_numpy_broadcast, - shape_inference_4D_x_1D_numpy_broadcast, - shape_inference_2D_x_4D_numpy_broadcast, - shape_inference_3D_x_4D_numpy_broadcast, - shape_inference_4D_x_3D_numpy_broadcast, - incompatible_element_types, - incompatible_boolean_type, - shape_inference_1D_x_1D_incompatible, - shape_inference_3D_x_3D_incompatible, - shape_inference_5D_x_5D_incompatible, - dynamic_shape_3D, - dynamic_shape_5D, - full_dynamic_shape); +REGISTER_TYPED_TEST_SUITE_P(ArithmeticOperator, + shape_inference_2D, + shape_inference_4D, + default_autobroadcast, + no_autobroadcast, + shape_inference_4D_x_scalar_numpy_broadcast, + shape_inference_4D_x_1D_numpy_broadcast, + shape_inference_2D_x_4D_numpy_broadcast, + shape_inference_3D_x_4D_numpy_broadcast, + shape_inference_4D_x_3D_numpy_broadcast, + incompatible_element_types, + incompatible_boolean_type, + shape_inference_1D_x_1D_incompatible, + shape_inference_3D_x_3D_incompatible, + shape_inference_5D_x_5D_incompatible, + dynamic_shape_3D, + dynamic_shape_5D, + full_dynamic_shape); diff --git a/ngraph/test/type_prop/asin.cpp b/ngraph/test/type_prop/asin.cpp index 96293580d57..221015198fe 100644 --- a/ngraph/test/type_prop/asin.cpp +++ b/ngraph/test/type_prop/asin.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_asin, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_asin, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/batch_norm.cpp b/ngraph/test/type_prop/batch_norm.cpp index 8a1fafd95b6..36a2b15d20c 100644 --- a/ngraph/test/type_prop/batch_norm.cpp +++ b/ngraph/test/type_prop/batch_norm.cpp @@ -24,13 +24,14 @@ struct BatchNormInferParams double epsilon; }; -template +template std::shared_ptr makeBatchNormOp(const BatchNormInferParams& p) { - if(p.inputs.size() != 4) + if (p.inputs.size() != 4) { - throw runtime_error("BatchNormInference requires 4 additional inputs for batch" - "normalization transformation"); + throw runtime_error( + "BatchNormInference requires 4 additional inputs for batch" + "normalization transformation"); } auto data_batch = make_shared(p.data_batch_et, p.data_batch_ps); auto gamma = make_shared(p.inputs[0].in_et, p.inputs[0].in_shape); @@ -40,25 +41,22 @@ std::shared_ptr makeBatchNormOp(const BatchNormInferParams& p) return make_shared(data_batch, gamma, beta, mean, variance, p.epsilon); } -template +template class BatchNormTest : public ::testing::Test { }; -TYPED_TEST_CASE_P(BatchNormTest); +TYPED_TEST_SUITE_P(BatchNormTest); TYPED_TEST_P(BatchNormTest, batch_norm_inference_basic_data_batch_rank_2) { PartialShape data_batch_shape{10, 100}; element::Type inputs_et = element::f32; - std::vector ch_inputs = - { - {inputs_et, PartialShape{100}, "gamma"}, - {inputs_et, PartialShape{100}, "beta"}, - {inputs_et, PartialShape{100}, "mean"}, - {inputs_et, PartialShape{100}, "variance"} - }; + std::vector ch_inputs = {{inputs_et, PartialShape{100}, "gamma"}, + {inputs_et, PartialShape{100}, "beta"}, + {inputs_et, PartialShape{100}, "mean"}, + {inputs_et, PartialShape{100}, "variance"}}; double epsilon = 0.001; @@ -76,13 +74,10 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_basic_data_batch_rank_4) PartialShape data_batch_shape{1, 10, 224, 224}; element::Type inputs_et = element::f16; - std::vector ch_inputs = - { - {inputs_et, PartialShape{10}, "gamma"}, - {inputs_et, PartialShape{10}, "beta"}, - {inputs_et, PartialShape{10}, "mean"}, - {inputs_et, PartialShape{10}, "variance"} - }; + std::vector ch_inputs = {{inputs_et, PartialShape{10}, "gamma"}, + {inputs_et, PartialShape{10}, "beta"}, + {inputs_et, PartialShape{10}, "mean"}, + {inputs_et, PartialShape{10}, "variance"}}; double epsilon = 0.001; @@ -100,13 +95,11 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_inputs_rank_dynamic) PartialShape data_batch_shape{PartialShape::dynamic()}; element::Type inputs_et = element::f32; - std::vector ch_inputs = - { + std::vector ch_inputs = { {inputs_et, PartialShape::dynamic(), "gamma"}, {inputs_et, PartialShape::dynamic(), "beta"}, {inputs_et, PartialShape::dynamic(), "mean"}, - {inputs_et, PartialShape::dynamic(), "variance"} - }; + {inputs_et, PartialShape::dynamic(), "variance"}}; double epsilon = 0.001; @@ -124,14 +117,12 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_data_batch_rank_static_channel_ 64, Dimension::dynamic(), Dimension::dynamic(), Dimension::dynamic()}; element::Type inputs_et = element::f32; - std::vector ch_inputs = - { + std::vector ch_inputs = { {inputs_et, PartialShape::dynamic(), "gamma"}, {inputs_et, PartialShape::dynamic(), "beta"}, {inputs_et, PartialShape::dynamic(), "mean"}, - {inputs_et, PartialShape::dynamic(), "variance"} - }; - + {inputs_et, PartialShape::dynamic(), "variance"}}; + double epsilon = 0.001; const BatchNormInferParams params{inputs_et, data_batch_shape, ch_inputs, epsilon}; @@ -143,21 +134,18 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_data_batch_rank_static_channel_ PartialShape{64, Dimension::dynamic(), Dimension::dynamic(), Dimension::dynamic()})); } -TYPED_TEST_P( - BatchNormTest, - batch_norm_inference_data_batch_rank_dynamic_some_channel_inputs_rank_static) +TYPED_TEST_P(BatchNormTest, + batch_norm_inference_data_batch_rank_dynamic_some_channel_inputs_rank_static) { PartialShape data_batch_shape{PartialShape::dynamic()}; element::Type input_et = element::f32; - std::vector inputs = - { + std::vector inputs = { {input_et, PartialShape{Dimension::dynamic()}, "gamma"}, {input_et, PartialShape::dynamic(), "beta"}, {input_et, PartialShape{Dimension::dynamic()}, "mean"}, - {input_et, PartialShape::dynamic(), "variance"} - }; - + {input_et, PartialShape::dynamic(), "variance"}}; + double epsilon = 0.001; const BatchNormInferParams params{input_et, data_batch_shape, inputs, epsilon}; @@ -174,13 +162,11 @@ TYPED_TEST_P(BatchNormTest, PartialShape data_batch_shape{64, Dimension::dynamic(), Dimension::dynamic(), 224}; element::Type input_et = element::f32; - std::vector inputs = - { + std::vector inputs = { {input_et, PartialShape{3}, "gamma"}, {input_et, PartialShape::dynamic(), "beta"}, {input_et, PartialShape{3}, "mean"}, - {input_et, PartialShape{Dimension::dynamic()}, "variance"} - }; + {input_et, PartialShape{Dimension::dynamic()}, "variance"}}; double epsilon = 0.001; @@ -197,29 +183,22 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_inputs_element_types) { PartialShape data_batch_shape{10, 100}; - const std::vector inputs_et{ - element::i32, - element::u32, - element::boolean - }; + const std::vector inputs_et{element::i32, element::u32, element::boolean}; double eps = 0.001; std::vector bn_tests; for (const auto& et : inputs_et) { - std::vector ch_inputs = - { - {et, PartialShape{100}, "gamma"}, - {et, PartialShape{100}, "beta"}, - {et, PartialShape{100}, "mean"}, - {et, PartialShape{100}, "variance"} - }; + std::vector ch_inputs = {{et, PartialShape{100}, "gamma"}, + {et, PartialShape{100}, "beta"}, + {et, PartialShape{100}, "mean"}, + {et, PartialShape{100}, "variance"}}; bn_tests.push_back(BatchNormInferParams{et, data_batch_shape, ch_inputs, eps}); } - for(const auto& params : bn_tests) + for (const auto& params : bn_tests) { try { @@ -244,48 +223,39 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_incompatible_inputs_element_typ const PartialShape data_batch_ps{10, 200}; // Invalid combination of element types of gamma/beta/mean/variance inputs - vector bn_ch_inputs = - { - {element::f32, PartialShape{200}, "gamma"}, - {element::f32, PartialShape{200}, "beta"}, - {element::f32, PartialShape{200}, "mean"}, - {element::f32, PartialShape{200}, "variance"} - }; + vector bn_ch_inputs = {{element::f32, PartialShape{200}, "gamma"}, + {element::f32, PartialShape{200}, "beta"}, + {element::f32, PartialShape{200}, "mean"}, + {element::f32, PartialShape{200}, "variance"}}; const double epsilon = 0.001; std::vector bn_params; - bn_params.push_back(BatchNormInferParams{element::f16, - data_batch_ps, - bn_ch_inputs, - epsilon}); + bn_params.push_back(BatchNormInferParams{element::f16, data_batch_ps, bn_ch_inputs, epsilon}); - for(size_t i = 0; i < bn_ch_inputs.size(); i++) + for (size_t i = 0; i < bn_ch_inputs.size(); i++) { std::vector inputs = bn_ch_inputs; (inputs[i]).in_et = element::f16; - bn_params.push_back(BatchNormInferParams{data_batch_et, - data_batch_ps, - inputs, - epsilon}); + bn_params.push_back(BatchNormInferParams{data_batch_et, data_batch_ps, inputs, epsilon}); } // Run tests with incompatible input element types - for(const auto& bn_p : bn_params) + for (const auto& bn_p : bn_params) { try { auto bn = makeBatchNormOp(bn_p); FAIL() << "Incompatible input element types not detected"; } - catch(const NodeValidationFailure& error) + catch (const NodeValidationFailure& error) { EXPECT_HAS_SUBSTRING(error.what(), "Input element types do not match"); } - catch(...) + catch (...) { FAIL() << "Input element types check failed for unexpected reason"; - } + } } } @@ -294,16 +264,14 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_data_batch_input_rank) PartialShape data_batch_shape{Dimension::dynamic()}; element::Type inputs_et = element::f32; - std::vector ch_inputs = - { + std::vector ch_inputs = { {inputs_et, PartialShape::dynamic(), "gamma"}, {inputs_et, PartialShape::dynamic(), "beta"}, {inputs_et, PartialShape::dynamic(), "mean"}, - {inputs_et, PartialShape::dynamic(), "variance"} - }; + {inputs_et, PartialShape::dynamic(), "variance"}}; double epsilon = 0.001; - + const BatchNormInferParams params{inputs_et, data_batch_shape, ch_inputs, epsilon}; try { @@ -312,8 +280,9 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_data_batch_input_rank) } catch (const NodeValidationFailure& error) { - EXPECT_HAS_SUBSTRING(error.what(), - "Input argument must have rank of at least 2 (input argument shape: {?})"); + EXPECT_HAS_SUBSTRING( + error.what(), + "Input argument must have rank of at least 2 (input argument shape: {?})"); } catch (...) { @@ -326,13 +295,11 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_incompatible_channel_input_rank PartialShape data_batch_shape{PartialShape::dynamic()}; element::Type input_et = element::f32; - std::vector inputs = - { + std::vector inputs = { {input_et, PartialShape{3, Dimension::dynamic()}, "gamma"}, {input_et, PartialShape::dynamic(), "beta"}, {input_et, PartialShape{Dimension::dynamic()}, "mean"}, - {input_et, PartialShape::dynamic(), "variance"} - }; + {input_et, PartialShape::dynamic(), "variance"}}; double epsilon = 0.001; @@ -344,8 +311,7 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_incompatible_channel_input_rank } catch (const NodeValidationFailure& error) { - EXPECT_HAS_SUBSTRING(error.what(), - "Shapes for gamma/beta/mean/variance do not match"); + EXPECT_HAS_SUBSTRING(error.what(), "Shapes for gamma/beta/mean/variance do not match"); } catch (...) { @@ -353,19 +319,15 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_incompatible_channel_input_rank } } -TYPED_TEST_P(BatchNormTest, - batch_norm_inference_incompatible_channel_inputs_channel_count) +TYPED_TEST_P(BatchNormTest, batch_norm_inference_incompatible_channel_inputs_channel_count) { PartialShape data_batch_shape{PartialShape::dynamic()}; element::Type input_et = element::f32; - std::vector inputs = - { - {input_et, PartialShape{3}, "gamma"}, - {input_et, PartialShape::dynamic(), "beta"}, - {input_et, PartialShape{4}, "mean"}, - {input_et, PartialShape::dynamic(), "variance"} - }; + std::vector inputs = {{input_et, PartialShape{3}, "gamma"}, + {input_et, PartialShape::dynamic(), "beta"}, + {input_et, PartialShape{4}, "mean"}, + {input_et, PartialShape::dynamic(), "variance"}}; double epsilon = 0.001; @@ -377,12 +339,12 @@ TYPED_TEST_P(BatchNormTest, } catch (const NodeValidationFailure& error) { - EXPECT_HAS_SUBSTRING(error.what(), - "Shapes for gamma/beta/mean/variance do not match"); + EXPECT_HAS_SUBSTRING(error.what(), "Shapes for gamma/beta/mean/variance do not match"); } catch (...) { - FAIL() << "gamma/beta/mean/variance inputs channel count check failed for unexpected reason"; + FAIL() + << "gamma/beta/mean/variance inputs channel count check failed for unexpected reason"; } } @@ -391,13 +353,11 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_channel_inputs_rank) PartialShape data_batch_shape{PartialShape::dynamic()}; element::Type input_et = element::f32; - std::vector inputs = - { + std::vector inputs = { {input_et, PartialShape{Dimension::dynamic(), Dimension::dynamic()}, "gamma"}, {input_et, PartialShape::dynamic(), "beta"}, {input_et, PartialShape{Dimension::dynamic(), Dimension::dynamic()}, "mean"}, - {input_et, PartialShape::dynamic(), "variance"} - }; + {input_et, PartialShape::dynamic(), "variance"}}; double epsilon = 0.001; @@ -409,9 +369,8 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_channel_inputs_rank) } catch (const NodeValidationFailure& error) { - EXPECT_HAS_SUBSTRING( - error.what(), - "Shape for gamma/beta/mean/variance ({?,?}) does not have rank 1"); + EXPECT_HAS_SUBSTRING(error.what(), + "Shape for gamma/beta/mean/variance ({?,?}) does not have rank 1"); } catch (...) { @@ -425,13 +384,10 @@ TYPED_TEST_P(BatchNormTest, PartialShape data_batch_shape{64, 4, Dimension::dynamic(), 224}; element::Type input_et = element::f32; - std::vector inputs = - { - {input_et, PartialShape{3}, "gamma"}, - {input_et, PartialShape::dynamic(), "beta"}, - {input_et, PartialShape{3}, "mean"}, - {input_et, PartialShape::dynamic(), "variance"} - }; + std::vector inputs = {{input_et, PartialShape{3}, "gamma"}, + {input_et, PartialShape::dynamic(), "beta"}, + {input_et, PartialShape{3}, "mean"}, + {input_et, PartialShape::dynamic(), "variance"}}; double epsilon = 0.001; @@ -443,12 +399,14 @@ TYPED_TEST_P(BatchNormTest, } catch (const NodeValidationFailure& error) { - EXPECT_HAS_SUBSTRING(error.what(), "Input channel dimension (4) does not match " - "shape for gamma/beta/mean/variance ({3})"); + EXPECT_HAS_SUBSTRING(error.what(), + "Input channel dimension (4) does not match " + "shape for gamma/beta/mean/variance ({3})"); } catch (...) { - FAIL() << "Data batch and gamma/beta/mean/variance channel count check failed for unexpected reason"; + FAIL() << "Data batch and gamma/beta/mean/variance channel count check failed for " + "unexpected reason"; } } @@ -458,16 +416,14 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_input_channels_count_ze Dimension::dynamic(), 0, Dimension::dynamic(), Dimension::dynamic()}; element::Type inputs_et = element::f32; - std::vector ch_inputs = - { + std::vector ch_inputs = { {inputs_et, PartialShape::dynamic(), "gamma"}, {inputs_et, PartialShape::dynamic(), "beta"}, {inputs_et, PartialShape::dynamic(), "mean"}, - {inputs_et, PartialShape::dynamic(), "variance"} - }; + {inputs_et, PartialShape::dynamic(), "variance"}}; double epsilon = 0.001; - + const BatchNormInferParams params{inputs_et, data_batch_shape, ch_inputs, epsilon}; try { @@ -489,13 +445,10 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_epsilon) PartialShape data_batch_shape{10, 100}; element::Type inputs_et = element::f32; - std::vector ch_inputs = - { - {inputs_et, PartialShape{100}, "gamma"}, - {inputs_et, PartialShape{100}, "beta"}, - {inputs_et, PartialShape{100}, "mean"}, - {inputs_et, PartialShape{100}, "variance"} - }; + std::vector ch_inputs = {{inputs_et, PartialShape{100}, "gamma"}, + {inputs_et, PartialShape{100}, "beta"}, + {inputs_et, PartialShape{100}, "mean"}, + {inputs_et, PartialShape{100}, "variance"}}; double eps_neg = -1.0; const BatchNormInferParams params{inputs_et, data_batch_shape, ch_inputs, eps_neg}; @@ -506,7 +459,9 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_epsilon) } catch (const NodeValidationFailure& error) { - EXPECT_HAS_SUBSTRING(error.what(), "Attribute 'epsilon' must be a floating-point value greater than or equal to zero."); + EXPECT_HAS_SUBSTRING( + error.what(), + "Attribute 'epsilon' must be a floating-point value greater than or equal to zero."); } catch (...) { @@ -514,7 +469,7 @@ TYPED_TEST_P(BatchNormTest, batch_norm_inference_invalid_epsilon) } } -REGISTER_TYPED_TEST_CASE_P( +REGISTER_TYPED_TEST_SUITE_P( BatchNormTest, batch_norm_inference_basic_data_batch_rank_2, batch_norm_inference_basic_data_batch_rank_4, @@ -533,4 +488,4 @@ REGISTER_TYPED_TEST_CASE_P( batch_norm_inference_invalid_epsilon); using Types = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop, BatchNormTest, Types); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop, BatchNormTest, Types); diff --git a/ngraph/test/type_prop/broadcast.cpp b/ngraph/test/type_prop/broadcast.cpp index aa24cec60bc..f9fa5c77b28 100644 --- a/ngraph/test/type_prop/broadcast.cpp +++ b/ngraph/test/type_prop/broadcast.cpp @@ -17,7 +17,7 @@ template class BroadcastTests : public ::testing::Test { }; -TYPED_TEST_CASE_P(BroadcastTests); +TYPED_TEST_SUITE_P(BroadcastTests); TYPED_TEST_P(BroadcastTests, broadcast_numpy) { @@ -617,41 +617,41 @@ TYPED_TEST_P(BroadcastTests, broadcast_numpy_static_dims_incorrect) } } -REGISTER_TYPED_TEST_CASE_P(BroadcastTests, - broadcast_numpy, - broadcast_axes_mapping, - broadcast_target_shape_as_concat_with_constants, - broadcast_target_shape_as_concat_with_node, - broadcast_fail_rank, - broadcast_fail_transpose, - broadcast_fail_axes_map, - broadcast_fail_axes_map_shape, - broadcast_axes_wrong_rank, - broadcast_fully_dynamic_target_shape, - broadcast_dynamic_values_of_target_shape, - broadcast_broadcast_shape_et_wrong, - broadcast_axes_et_wrong, - broadcast_explicit_all_inputs_dynamic, - broadcast_explicit_target_shape_static_rank, - broadcast_explicit_const_target_shape, - broadcast_explicit_input_rank_static, - broadcast_explicit_target_shape_and_input_data_rank_static, - broadcast_explicit_const_target_shape_static_rank_input, - broadcast_explicit_static_input_shape, - broadcast_explicit_static_input_shape_const_target_shape, - broadcast_explicit_static_target_shape, - broadcast_numpy_input_shape_dynamic, - broadcast_numpy_target_shape_constant, - broadcast_numpy_target_shape_dynamic, - broadcast_numpy_input_target_shape_static_rank, - broadcast_numpy_input_static_shape, - broadcast_numpy_input_partially_dynamic, - broadcast_numpy_static_dims_incorrect); +REGISTER_TYPED_TEST_SUITE_P(BroadcastTests, + broadcast_numpy, + broadcast_axes_mapping, + broadcast_target_shape_as_concat_with_constants, + broadcast_target_shape_as_concat_with_node, + broadcast_fail_rank, + broadcast_fail_transpose, + broadcast_fail_axes_map, + broadcast_fail_axes_map_shape, + broadcast_axes_wrong_rank, + broadcast_fully_dynamic_target_shape, + broadcast_dynamic_values_of_target_shape, + broadcast_broadcast_shape_et_wrong, + broadcast_axes_et_wrong, + broadcast_explicit_all_inputs_dynamic, + broadcast_explicit_target_shape_static_rank, + broadcast_explicit_const_target_shape, + broadcast_explicit_input_rank_static, + broadcast_explicit_target_shape_and_input_data_rank_static, + broadcast_explicit_const_target_shape_static_rank_input, + broadcast_explicit_static_input_shape, + broadcast_explicit_static_input_shape_const_target_shape, + broadcast_explicit_static_target_shape, + broadcast_numpy_input_shape_dynamic, + broadcast_numpy_target_shape_constant, + broadcast_numpy_target_shape_dynamic, + broadcast_numpy_input_target_shape_static_rank, + broadcast_numpy_input_static_shape, + broadcast_numpy_input_partially_dynamic, + broadcast_numpy_static_dims_incorrect); typedef ::testing::Types BroadcastTypes; // the last empty argument resolves compiler warning on MAC: // `must specify at least one argument for '...'` (variadic macro) -INSTANTIATE_TYPED_TEST_CASE_P(type_prop, BroadcastTests, BroadcastTypes, ); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop, BroadcastTests, BroadcastTypes, ); // changing AutoBroadcastSpec to BroadcastModeSpec forces runing pdpd tests separately TEST(type_prop, broadcast_v1_pdpd) diff --git a/ngraph/test/type_prop/ceiling.cpp b/ngraph/test/type_prop/ceiling.cpp index f173a031491..34b93256057 100644 --- a/ngraph/test/type_prop/ceiling.cpp +++ b/ngraph/test/type_prop/ceiling.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_ceiling, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_ceiling, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/convolution.cpp b/ngraph/test/type_prop/convolution.cpp index 5b43208492f..fdd757da1a6 100644 --- a/ngraph/test/type_prop/convolution.cpp +++ b/ngraph/test/type_prop/convolution.cpp @@ -282,50 +282,50 @@ TEST_P(DeduceAutoPadTest, same_lower) EXPECT_EQ(conv->get_padding_below(), std::get<5>(GetParam())); } -INSTANTIATE_TEST_CASE_P(type_prop, - DeduceAutoPadTest, - ::testing::Values(std::make_tuple(Shape{5, 6}, - Shape{3, 4}, - Strides{2, 1}, - Strides{1, 1}, - CoordinateDiff{1, 1}, - CoordinateDiff{1, 2}), - std::make_tuple(Shape{3, 3}, - Shape{2, 2}, - Strides{1, 1}, - Strides{1, 1}, - CoordinateDiff{0, 0}, - CoordinateDiff{1, 1}), - std::make_tuple(Shape{28, 28}, - Shape{3, 3}, - Strides{2, 2}, - Strides{1, 1}, - CoordinateDiff{0, 0}, - CoordinateDiff{1, 1}), - std::make_tuple(Shape{100, 150}, - Shape{10, 20}, - Strides{1, 1}, - Strides{1, 1}, - CoordinateDiff{4, 9}, - CoordinateDiff{5, 10}), - std::make_tuple(Shape{2}, - Shape{1}, - Strides{3}, - Strides{1}, - CoordinateDiff{0}, - CoordinateDiff{0}), - std::make_tuple(Shape{10, 1}, - Shape{4, 1}, - Strides{1, 1}, - Strides{2, 1}, - CoordinateDiff{3, 0}, - CoordinateDiff{3, 0}), - std::make_tuple(Shape{10, 5, 6}, - Shape{3, 3, 4}, - Strides{1, 2, 1}, - Strides{2, 1, 1}, - CoordinateDiff{2, 1, 1}, - CoordinateDiff{2, 1, 2})), ); +INSTANTIATE_TEST_SUITE_P(type_prop, + DeduceAutoPadTest, + ::testing::Values(std::make_tuple(Shape{5, 6}, + Shape{3, 4}, + Strides{2, 1}, + Strides{1, 1}, + CoordinateDiff{1, 1}, + CoordinateDiff{1, 2}), + std::make_tuple(Shape{3, 3}, + Shape{2, 2}, + Strides{1, 1}, + Strides{1, 1}, + CoordinateDiff{0, 0}, + CoordinateDiff{1, 1}), + std::make_tuple(Shape{28, 28}, + Shape{3, 3}, + Strides{2, 2}, + Strides{1, 1}, + CoordinateDiff{0, 0}, + CoordinateDiff{1, 1}), + std::make_tuple(Shape{100, 150}, + Shape{10, 20}, + Strides{1, 1}, + Strides{1, 1}, + CoordinateDiff{4, 9}, + CoordinateDiff{5, 10}), + std::make_tuple(Shape{2}, + Shape{1}, + Strides{3}, + Strides{1}, + CoordinateDiff{0}, + CoordinateDiff{0}), + std::make_tuple(Shape{10, 1}, + Shape{4, 1}, + Strides{1, 1}, + Strides{2, 1}, + CoordinateDiff{3, 0}, + CoordinateDiff{3, 0}), + std::make_tuple(Shape{10, 5, 6}, + Shape{3, 3, 4}, + Strides{1, 2, 1}, + Strides{2, 1, 1}, + CoordinateDiff{2, 1, 1}, + CoordinateDiff{2, 1, 2}))); TEST(type_prop, conv_2d_deduce_strided) { diff --git a/ngraph/test/type_prop/dft.cpp b/ngraph/test/type_prop/dft.cpp index c1fce89e038..e02a45292ed 100644 --- a/ngraph/test/type_prop/dft.cpp +++ b/ngraph/test/type_prop/dft.cpp @@ -58,7 +58,7 @@ TEST_P(ConstantAxesAndConstantSignalSizeTest, dft_constant_axes_and_signal_size) ASSERT_TRUE(dft->get_output_partial_shape(0).same_scheme(params.ref_output_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, ConstantAxesAndConstantSignalSizeTest, ::testing::Values( @@ -194,10 +194,8 @@ TEST(type_prop, dft_dynamic_axes) { const auto input_shape = PartialShape{2, 180, 180, Dimension(1, 18)}; const auto axes_shape = PartialShape::dynamic(); - const auto ref_output_shape = PartialShape{Dimension::dynamic(), - Dimension::dynamic(), - Dimension::dynamic(), - Dimension(1, 18)}; + const auto ref_output_shape = PartialShape{ + Dimension::dynamic(), Dimension::dynamic(), Dimension::dynamic(), Dimension(1, 18)}; auto data = std::make_shared(element::f32, input_shape); auto axes_input = std::make_shared(element::i64, axes_shape); @@ -230,7 +228,7 @@ TEST_P(NonConstantAxesTest, dft_non_constant_axes) ASSERT_TRUE(dft->get_output_partial_shape(0).same_scheme(params.ref_output_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, NonConstantAxesTest, ::testing::Values( @@ -323,7 +321,7 @@ TEST_P(NonConstantSignalSizeTest, dft_non_constant_signal_size) ASSERT_TRUE(dft->get_output_partial_shape(0).same_scheme(params.ref_output_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, NonConstantSignalSizeTest, ::testing::Values( diff --git a/ngraph/test/type_prop/divide.cpp b/ngraph/test/type_prop/divide.cpp index 599312f77cf..ee2dcffde43 100644 --- a/ngraph/test/type_prop/divide.cpp +++ b/ngraph/test/type_prop/divide.cpp @@ -18,4 +18,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_divide, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_divide, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/exp.cpp b/ngraph/test/type_prop/exp.cpp index f25c335504e..4b1192d3b5f 100644 --- a/ngraph/test/type_prop/exp.cpp +++ b/ngraph/test/type_prop/exp.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_exp, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_exp, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/experimental_detectron_prior_grid_generator.cpp b/ngraph/test/type_prop/experimental_detectron_prior_grid_generator.cpp index 6f7b9024d49..88070d94f32 100644 --- a/ngraph/test/type_prop/experimental_detectron_prior_grid_generator.cpp +++ b/ngraph/test/type_prop/experimental_detectron_prior_grid_generator.cpp @@ -138,7 +138,7 @@ TEST_P(GridGeneratorIntervalsTest, detectron_grid_generator_dynamic_shapes_inter ASSERT_TRUE(grid_gen->get_output_partial_shape(0).same_scheme(params.ref_out_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, GridGeneratorIntervalsTest, ::testing::Values( diff --git a/ngraph/test/type_prop/experimental_detectron_roi_feature_extractor.cpp b/ngraph/test/type_prop/experimental_detectron_roi_feature_extractor.cpp index f2fa6d26613..55bb9d49d2d 100644 --- a/ngraph/test/type_prop/experimental_detectron_roi_feature_extractor.cpp +++ b/ngraph/test/type_prop/experimental_detectron_roi_feature_extractor.cpp @@ -124,7 +124,7 @@ TEST_P(ROIFeatureIntervalsTest, detectron_roi_feature_extractor_intervals_1) ASSERT_TRUE(roi->get_output_partial_shape(0).same_scheme(ref_out_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, ROIFeatureIntervalsTest, ::testing::Values( @@ -310,7 +310,7 @@ TEST_P(ROIFeatureIntervalsSameFirstDimsTest, detectron_roi_feature_extractor_int ASSERT_TRUE(roi->get_output_partial_shape(0).same_scheme(ref_out_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, ROIFeatureIntervalsSameFirstDimsTest, ::testing::Values( diff --git a/ngraph/test/type_prop/floor.cpp b/ngraph/test/type_prop/floor.cpp index 3eca60835f0..9cf6956f874 100644 --- a/ngraph/test/type_prop/floor.cpp +++ b/ngraph/test/type_prop/floor.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_floor, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_floor, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/floor_mod.cpp b/ngraph/test/type_prop/floor_mod.cpp index 243e6f3c6e8..602ff2f6725 100644 --- a/ngraph/test/type_prop/floor_mod.cpp +++ b/ngraph/test/type_prop/floor_mod.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_floormod, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_floormod, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/idft.cpp b/ngraph/test/type_prop/idft.cpp index 9fdd315a2b3..6d6e50319d6 100644 --- a/ngraph/test/type_prop/idft.cpp +++ b/ngraph/test/type_prop/idft.cpp @@ -46,7 +46,7 @@ TEST_P(ConstantAxesAndConstantSignalSizeTest, idft_constant_axes_and_signal_size ASSERT_TRUE(idft->get_output_partial_shape(0).same_scheme(params.ref_output_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, ConstantAxesAndConstantSignalSizeTest, ::testing::Values( @@ -182,10 +182,8 @@ TEST(type_prop, idft_dynamic_axes) { const auto input_shape = PartialShape{2, 180, 180, Dimension(1, 18)}; const auto axes_shape = PartialShape::dynamic(); - const auto ref_output_shape = PartialShape{Dimension::dynamic(), - Dimension::dynamic(), - Dimension::dynamic(), - Dimension(1, 18)}; + const auto ref_output_shape = PartialShape{ + Dimension::dynamic(), Dimension::dynamic(), Dimension::dynamic(), Dimension(1, 18)}; auto data = std::make_shared(element::f32, input_shape); auto axes_input = std::make_shared(element::i64, axes_shape); @@ -218,7 +216,7 @@ TEST_P(NonConstantAxesTest, idft_non_constant_axes) ASSERT_TRUE(idft->get_output_partial_shape(0).same_scheme(params.ref_output_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, NonConstantAxesTest, ::testing::Values( @@ -311,7 +309,7 @@ TEST_P(NonConstantSignalSizeTest, idft_non_constant_signal_size) ASSERT_TRUE(idft->get_output_partial_shape(0).same_scheme(params.ref_output_shape)); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, NonConstantSignalSizeTest, ::testing::Values( diff --git a/ngraph/test/type_prop/maximum.cpp b/ngraph/test/type_prop/maximum.cpp index 51ac0a79858..34469c07be3 100644 --- a/ngraph/test/type_prop/maximum.cpp +++ b/ngraph/test/type_prop/maximum.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_maximum, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_maximum, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/minimum.cpp b/ngraph/test/type_prop/minimum.cpp index f62373923d5..4dc78093751 100644 --- a/ngraph/test/type_prop/minimum.cpp +++ b/ngraph/test/type_prop/minimum.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_minimum, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_minimum, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/mod.cpp b/ngraph/test/type_prop/mod.cpp index bfde883012b..d5fda0e6a72 100644 --- a/ngraph/test/type_prop/mod.cpp +++ b/ngraph/test/type_prop/mod.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_mod, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_mod, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/multiply.cpp b/ngraph/test/type_prop/multiply.cpp index 423aaa78ace..d8b5f3b0346 100644 --- a/ngraph/test/type_prop/multiply.cpp +++ b/ngraph/test/type_prop/multiply.cpp @@ -18,4 +18,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_multiply, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_multiply, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/negative.cpp b/ngraph/test/type_prop/negative.cpp index 68313c2f544..14b6f9c4d0f 100644 --- a/ngraph/test/type_prop/negative.cpp +++ b/ngraph/test/type_prop/negative.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_negative, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_negative, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/power.cpp b/ngraph/test/type_prop/power.cpp index c8e3580cb6a..ca5e98bea99 100644 --- a/ngraph/test/type_prop/power.cpp +++ b/ngraph/test/type_prop/power.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_power, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_power, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/range.cpp b/ngraph/test/type_prop/range.cpp index 56913fabf6d..9fe673e60b7 100644 --- a/ngraph/test/type_prop/range.cpp +++ b/ngraph/test/type_prop/range.cpp @@ -419,15 +419,15 @@ TEST_P(RangeTest, deduce_shape_f64) run_range_test(element::f64, GetParam()); } -INSTANTIATE_TEST_CASE_P(type_prop, - RangeTest, - ::testing::Values(RangeParams{0, 5, 1, PartialShape{5}}, - RangeParams{0, 22, 2, PartialShape{11}}, - RangeParams{1, 23, 2, PartialShape{11}}, - RangeParams{1, 22, 2, PartialShape{11}}, - RangeParams{0, 0, 1, PartialShape{0}}, - RangeParams{1, 0, 2, PartialShape{0}}), - PrintToDummyParamName()); +INSTANTIATE_TEST_SUITE_P(type_prop, + RangeTest, + ::testing::Values(RangeParams{0, 5, 1, PartialShape{5}}, + RangeParams{0, 22, 2, PartialShape{11}}, + RangeParams{1, 23, 2, PartialShape{11}}, + RangeParams{1, 22, 2, PartialShape{11}}, + RangeParams{0, 0, 1, PartialShape{0}}, + RangeParams{1, 0, 2, PartialShape{0}}), + PrintToDummyParamName()); struct RangeTestWithNegatives : ::testing::TestWithParam { @@ -473,14 +473,14 @@ TEST_P(RangeTestWithNegatives, deduce_shape_f64) run_range_test(element::f64, GetParam()); } -INSTANTIATE_TEST_CASE_P(type_prop, - RangeTestWithNegatives, - ::testing::Values(RangeParams{2, 0, -2, PartialShape{1}}, - RangeParams{2, 0, -1, PartialShape{2}}, - RangeParams{-19, 19, 1, PartialShape{38}}, - RangeParams{-19, 19, 3, PartialShape{13}}, - RangeParams{20, -19, 1, PartialShape{0}}), - PrintToDummyParamName()); +INSTANTIATE_TEST_SUITE_P(type_prop, + RangeTestWithNegatives, + ::testing::Values(RangeParams{2, 0, -2, PartialShape{1}}, + RangeParams{2, 0, -1, PartialShape{2}}, + RangeParams{-19, 19, 1, PartialShape{38}}, + RangeParams{-19, 19, 3, PartialShape{13}}, + RangeParams{20, -19, 1, PartialShape{0}}), + PrintToDummyParamName()); struct RangeTestFloating : ::testing::TestWithParam { @@ -506,12 +506,12 @@ TEST_P(RangeTestFloating, deduce_shape_f64) run_range_test(element::f64, GetParam()); } -INSTANTIATE_TEST_CASE_P(type_prop, - RangeTestFloating, - ::testing::Values(RangeParams{0, 1, 0.25, PartialShape{4}}, - RangeParams{-1, 1, 0.25, PartialShape{8}}, - RangeParams{-1, 0.875, 0.25, PartialShape{8}}), - PrintToDummyParamName()); +INSTANTIATE_TEST_SUITE_P(type_prop, + RangeTestFloating, + ::testing::Values(RangeParams{0, 1, 0.25, PartialShape{4}}, + RangeParams{-1, 1, 0.25, PartialShape{8}}, + RangeParams{-1, 0.875, 0.25, PartialShape{8}}), + PrintToDummyParamName()); // ------------------------------ V4 ------------------------------ @@ -973,15 +973,15 @@ TEST_P(RangeNumpyTest, deduce_shape_f64) run_range_v4_test(element::f64, GetParam()); } -INSTANTIATE_TEST_CASE_P(type_prop, - RangeNumpyTest, - ::testing::Values(RangeParams{0, 5, 1, PartialShape{5}}, - RangeParams{0, 22, 2, PartialShape{11}}, - RangeParams{1, 23, 2, PartialShape{11}}, - RangeParams{1, 22, 2, PartialShape{11}}, - RangeParams{0, 0, 1, PartialShape{0}}, - RangeParams{1, 0, 2, PartialShape{0}}), - PrintToDummyParamName()); +INSTANTIATE_TEST_SUITE_P(type_prop, + RangeNumpyTest, + ::testing::Values(RangeParams{0, 5, 1, PartialShape{5}}, + RangeParams{0, 22, 2, PartialShape{11}}, + RangeParams{1, 23, 2, PartialShape{11}}, + RangeParams{1, 22, 2, PartialShape{11}}, + RangeParams{0, 0, 1, PartialShape{0}}, + RangeParams{1, 0, 2, PartialShape{0}}), + PrintToDummyParamName()); struct RangeNumpyTestWithNegatives : ::testing::TestWithParam { @@ -1027,14 +1027,14 @@ TEST_P(RangeNumpyTestWithNegatives, deduce_shape_f64) run_range_v4_test(element::f64, GetParam()); } -INSTANTIATE_TEST_CASE_P(type_prop, - RangeNumpyTestWithNegatives, - ::testing::Values(RangeParams{2, 0, -2, PartialShape{1}}, - RangeParams{2, 0, -1, PartialShape{2}}, - RangeParams{-19, 19, 1, PartialShape{38}}, - RangeParams{-19, 19, 3, PartialShape{13}}, - RangeParams{20, -19, 1, PartialShape{0}}), - PrintToDummyParamName()); +INSTANTIATE_TEST_SUITE_P(type_prop, + RangeNumpyTestWithNegatives, + ::testing::Values(RangeParams{2, 0, -2, PartialShape{1}}, + RangeParams{2, 0, -1, PartialShape{2}}, + RangeParams{-19, 19, 1, PartialShape{38}}, + RangeParams{-19, 19, 3, PartialShape{13}}, + RangeParams{20, -19, 1, PartialShape{0}}), + PrintToDummyParamName()); struct RangeNumpyTestFloating : ::testing::TestWithParam { @@ -1060,9 +1060,9 @@ TEST_P(RangeNumpyTestFloating, deduce_shape_f64) run_range_v4_test(element::f64, GetParam()); } -INSTANTIATE_TEST_CASE_P(type_prop, - RangeNumpyTestFloating, - ::testing::Values(RangeParams{0, 1, 0.25, PartialShape{4}}, - RangeParams{-1, 1, 0.25, PartialShape{8}}, - RangeParams{-1, 0.875, 0.25, PartialShape{8}}), - PrintToDummyParamName()); +INSTANTIATE_TEST_SUITE_P(type_prop, + RangeNumpyTestFloating, + ::testing::Values(RangeParams{0, 1, 0.25, PartialShape{4}}, + RangeParams{-1, 1, 0.25, PartialShape{8}}, + RangeParams{-1, 0.875, 0.25, PartialShape{8}}), + PrintToDummyParamName()); diff --git a/ngraph/test/type_prop/reduce_l1.cpp b/ngraph/test/type_prop/reduce_l1.cpp index 03f22e20f82..f58b22ad8a2 100644 --- a/ngraph/test/type_prop/reduce_l1.cpp +++ b/ngraph/test/type_prop/reduce_l1.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_l1, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_l1_et, ReduceArithmeticTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_l1, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_l1_et, ReduceArithmeticTest, Type); diff --git a/ngraph/test/type_prop/reduce_l2.cpp b/ngraph/test/type_prop/reduce_l2.cpp index 64a9c02fb87..fb48089040d 100644 --- a/ngraph/test/type_prop/reduce_l2.cpp +++ b/ngraph/test/type_prop/reduce_l2.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_l2, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_l2_et, ReduceArithmeticTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_l2, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_l2_et, ReduceArithmeticTest, Type); diff --git a/ngraph/test/type_prop/reduce_logical_and.cpp b/ngraph/test/type_prop/reduce_logical_and.cpp index f6e051bb50f..71116b727de 100644 --- a/ngraph/test/type_prop/reduce_logical_and.cpp +++ b/ngraph/test/type_prop/reduce_logical_and.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_logical_and, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_logical_and_et, ReduceLogicalTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_logical_and, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_logical_and_et, ReduceLogicalTest, Type); diff --git a/ngraph/test/type_prop/reduce_logical_or.cpp b/ngraph/test/type_prop/reduce_logical_or.cpp index b73d1789a20..87c96a2270c 100644 --- a/ngraph/test/type_prop/reduce_logical_or.cpp +++ b/ngraph/test/type_prop/reduce_logical_or.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_logical_or, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_logical_or_et, ReduceLogicalTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_logical_or, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_logical_or_et, ReduceLogicalTest, Type); diff --git a/ngraph/test/type_prop/reduce_max.cpp b/ngraph/test/type_prop/reduce_max.cpp index d907d1066af..c1c0c96130f 100644 --- a/ngraph/test/type_prop/reduce_max.cpp +++ b/ngraph/test/type_prop/reduce_max.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_max, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_max_et, ReduceArithmeticTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_max, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_max_et, ReduceArithmeticTest, Type); diff --git a/ngraph/test/type_prop/reduce_mean.cpp b/ngraph/test/type_prop/reduce_mean.cpp index 607e8392f1e..ae545572d93 100644 --- a/ngraph/test/type_prop/reduce_mean.cpp +++ b/ngraph/test/type_prop/reduce_mean.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_mean, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_mean_et, ReduceArithmeticTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_mean, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_mean_et, ReduceArithmeticTest, Type); diff --git a/ngraph/test/type_prop/reduce_min.cpp b/ngraph/test/type_prop/reduce_min.cpp index d02f12f8a0a..a769b918644 100644 --- a/ngraph/test/type_prop/reduce_min.cpp +++ b/ngraph/test/type_prop/reduce_min.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_min, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_min_et, ReduceArithmeticTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_min, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_min_et, ReduceArithmeticTest, Type); diff --git a/ngraph/test/type_prop/reduce_ops.hpp b/ngraph/test/type_prop/reduce_ops.hpp index 9aa7503e448..e41724e0388 100644 --- a/ngraph/test/type_prop/reduce_ops.hpp +++ b/ngraph/test/type_prop/reduce_ops.hpp @@ -19,7 +19,7 @@ struct ReduceParams bool keep_dims; }; -template +template static std::shared_ptr makeReduceOp(const ReduceParams& p, bool axes_as_param = false) { auto in_data = make_shared(p.data_et, p.data_ps); @@ -39,12 +39,12 @@ static std::shared_ptr makeReduceOp(const ReduceParams& p, bool axes_as_pa return make_shared(in_data, in_axes, p.keep_dims); } -template +template class ReduceTest : public testing::Test { }; -TYPED_TEST_CASE_P(ReduceTest); +TYPED_TEST_SUITE_P(ReduceTest); TYPED_TEST_P(ReduceTest, reduce_basic_shape_infer) { @@ -290,27 +290,26 @@ TYPED_TEST_P(ReduceTest, reduce_invalid_axes_et) } } -REGISTER_TYPED_TEST_CASE_P( - ReduceTest, - reduce_basic_shape_infer, - reduce_basic_shape_infer_keep_dims, - reduce_basic_shape_infer_scalar_axis, - reduce_basic_shape_infer_axes_as_param, - reduce_dynamic_shape_data, - reduce_dynamic_shape_reduced_axes_static, - reduce_dynamic_shape_reduced_axes_static_keep_dims, - reduce_dynamic_shape_reduced_axes_not_static, - reduce_dynamic_shape_reduced_axes_not_static_keep_dims, - reduce_invalid_axis_out_of_range, - reduce_invalid_axes_shape, - reduce_invalid_axes_et); +REGISTER_TYPED_TEST_SUITE_P(ReduceTest, + reduce_basic_shape_infer, + reduce_basic_shape_infer_keep_dims, + reduce_basic_shape_infer_scalar_axis, + reduce_basic_shape_infer_axes_as_param, + reduce_dynamic_shape_data, + reduce_dynamic_shape_reduced_axes_static, + reduce_dynamic_shape_reduced_axes_static_keep_dims, + reduce_dynamic_shape_reduced_axes_not_static, + reduce_dynamic_shape_reduced_axes_not_static_keep_dims, + reduce_invalid_axis_out_of_range, + reduce_invalid_axes_shape, + reduce_invalid_axes_et); -template +template class ReduceArithmeticTest : public testing::Test { }; -TYPED_TEST_CASE_P(ReduceArithmeticTest); +TYPED_TEST_SUITE_P(ReduceArithmeticTest); TYPED_TEST_P(ReduceArithmeticTest, reduce_arithmetic_invalid_data_et) { @@ -339,23 +338,18 @@ TYPED_TEST_P(ReduceArithmeticTest, reduce_arithmetic_invalid_data_et) } } -REGISTER_TYPED_TEST_CASE_P( - ReduceArithmeticTest, - reduce_arithmetic_invalid_data_et); +REGISTER_TYPED_TEST_SUITE_P(ReduceArithmeticTest, reduce_arithmetic_invalid_data_et); -template +template class ReduceLogicalTest : public testing::Test { }; -TYPED_TEST_CASE_P(ReduceLogicalTest); +TYPED_TEST_SUITE_P(ReduceLogicalTest); TYPED_TEST_P(ReduceLogicalTest, reduce_logical_invalid_data_et) { - std::vector element_types{ - element::f32, - element::i32, - element::u32}; + std::vector element_types{element::f32, element::i32, element::u32}; PartialShape data_ps{1, 2, 3}; element::Type axes_et = element::i32; @@ -380,9 +374,7 @@ TYPED_TEST_P(ReduceLogicalTest, reduce_logical_invalid_data_et) { FAIL() << "Data input element type validation check failed for unexpected reason"; } - } + } } -REGISTER_TYPED_TEST_CASE_P( - ReduceLogicalTest, - reduce_logical_invalid_data_et); +REGISTER_TYPED_TEST_SUITE_P(ReduceLogicalTest, reduce_logical_invalid_data_et); diff --git a/ngraph/test/type_prop/reduce_prod.cpp b/ngraph/test/type_prop/reduce_prod.cpp index 3a6ea0a9e89..3c49a59c652 100644 --- a/ngraph/test/type_prop/reduce_prod.cpp +++ b/ngraph/test/type_prop/reduce_prod.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_prod, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_prod_et, ReduceArithmeticTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_prod, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_prod_et, ReduceArithmeticTest, Type); diff --git a/ngraph/test/type_prop/reduce_sum.cpp b/ngraph/test/type_prop/reduce_sum.cpp index 7bfce1dfc70..3234c53e652 100644 --- a/ngraph/test/type_prop/reduce_sum.cpp +++ b/ngraph/test/type_prop/reduce_sum.cpp @@ -5,5 +5,5 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_sum, ReduceTest, Type); -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_reduce_sum_et, ReduceArithmeticTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_sum, ReduceTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_reduce_sum_et, ReduceArithmeticTest, Type); diff --git a/ngraph/test/type_prop/select.cpp b/ngraph/test/type_prop/select.cpp index 31eee863e59..64313c2be1a 100644 --- a/ngraph/test/type_prop/select.cpp +++ b/ngraph/test/type_prop/select.cpp @@ -274,7 +274,7 @@ TEST_P(DeduceV1SelectTest, output_shape) ASSERT_EQ(select->get_element_type(), tp.ets[3]); } -INSTANTIATE_TEST_CASE_P( +INSTANTIATE_TEST_SUITE_P( type_prop, DeduceV1SelectTest, ::testing::Values(SelectParams({{2, 4}, {2, 4}, {2, 4}, {2, 4}}, diff --git a/ngraph/test/type_prop/sin.cpp b/ngraph/test/type_prop/sin.cpp index ab777d9a442..c8a9a088b2a 100644 --- a/ngraph/test/type_prop/sin.cpp +++ b/ngraph/test/type_prop/sin.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_sin, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_sin, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/sqrt.cpp b/ngraph/test/type_prop/sqrt.cpp index 48a5ce13a85..1c7dadff6ef 100644 --- a/ngraph/test/type_prop/sqrt.cpp +++ b/ngraph/test/type_prop/sqrt.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_sqrt, UnaryOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_sqrt, UnaryOperator, Type); diff --git a/ngraph/test/type_prop/squared_difference.cpp b/ngraph/test/type_prop/squared_difference.cpp index 49194ffa9f0..a1906bca171 100644 --- a/ngraph/test/type_prop/squared_difference.cpp +++ b/ngraph/test/type_prop/squared_difference.cpp @@ -6,4 +6,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_squared_difference, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_squared_difference, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/subtract.cpp b/ngraph/test/type_prop/subtract.cpp index a36447311e1..a935d4e4ee4 100644 --- a/ngraph/test/type_prop/subtract.cpp +++ b/ngraph/test/type_prop/subtract.cpp @@ -18,4 +18,4 @@ using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop_subtract, ArithmeticOperator, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_subtract, ArithmeticOperator, Type); diff --git a/ngraph/test/type_prop/top_k.cpp b/ngraph/test/type_prop/top_k.cpp index 768f533cc0c..fd77188d26d 100644 --- a/ngraph/test/type_prop/top_k.cpp +++ b/ngraph/test/type_prop/top_k.cpp @@ -14,7 +14,7 @@ template class topk_type_prop : public ::testing::Test { }; -TYPED_TEST_CASE_P(topk_type_prop); +TYPED_TEST_SUITE_P(topk_type_prop); TYPED_TEST_P(topk_type_prop, topk_negative_axis_support) { @@ -104,12 +104,12 @@ TYPED_TEST_P(topk_type_prop, topk_rank_static_k_unknown) } } -REGISTER_TYPED_TEST_CASE_P(topk_type_prop, - topk_negative_axis_support, - topk_negative_axis_dynamic_rank, - topk_v1_partial_ouptut, - topk_rank_static_k_unknown, - topk_default_index_element_type); +REGISTER_TYPED_TEST_SUITE_P(topk_type_prop, + topk_negative_axis_support, + topk_negative_axis_dynamic_rank, + topk_v1_partial_ouptut, + topk_rank_static_k_unknown, + topk_default_index_element_type); typedef ::testing::Types TopKTypes; -INSTANTIATE_TYPED_TEST_CASE_P(type_prop, topk_type_prop, TopKTypes, ); +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop, topk_type_prop, TopKTypes, ); diff --git a/ngraph/test/type_prop/unary_ops.hpp b/ngraph/test/type_prop/unary_ops.hpp index e8babcba406..5209d7fef37 100644 --- a/ngraph/test/type_prop/unary_ops.hpp +++ b/ngraph/test/type_prop/unary_ops.hpp @@ -13,7 +13,7 @@ class UnaryOperator : public testing::Test { }; -TYPED_TEST_CASE_P(UnaryOperator); +TYPED_TEST_SUITE_P(UnaryOperator); TYPED_TEST_P(UnaryOperator, shape_inference_Shape1) { @@ -84,14 +84,14 @@ TYPED_TEST_P(UnaryOperator, dynamic_rank_input_shape_full) ASSERT_TRUE(op->get_output_partial_shape(0).same_scheme(PartialShape::dynamic())); } -REGISTER_TYPED_TEST_CASE_P(UnaryOperator, - shape_inference_Shape1, - shape_inference_Shape2, - input_type_inference_F32, - input_type_inference_I64, - input_type_inference_U16, - incompatible_input_type_Shape1, - incompatible_input_type_Shape2, - dynamic_rank_input_shape_2D, - dynamic_rank_input_shape_3D, - dynamic_rank_input_shape_full); +REGISTER_TYPED_TEST_SUITE_P(UnaryOperator, + shape_inference_Shape1, + shape_inference_Shape2, + input_type_inference_F32, + input_type_inference_I64, + input_type_inference_U16, + incompatible_input_type_Shape1, + incompatible_input_type_Shape2, + dynamic_rank_input_shape_2D, + dynamic_rank_input_shape_3D, + dynamic_rank_input_shape_full); diff --git a/ngraph/test/util/CMakeLists.txt b/ngraph/test/util/CMakeLists.txt index 91f790a1185..8006d2738ff 100644 --- a/ngraph/test/util/CMakeLists.txt +++ b/ngraph/test/util/CMakeLists.txt @@ -31,7 +31,7 @@ if(NGRAPH_LIB_VERSIONING_ENABLE) VERSION ${NGRAPH_VERSION}) endif() target_include_directories(ngraph_test_util PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/.. ${IE_MAIN_SOURCE_DIR}/include) -target_link_libraries(ngraph_test_util PUBLIC ngraph ngraph_backend libgtest) +target_link_libraries(ngraph_test_util PUBLIC ngraph ngraph_backend gtest gmock) if (NGRAPH_ONNX_IMPORT_ENABLE) target_link_libraries(ngraph_test_util PRIVATE onnx_common) endif() diff --git a/ngraph/test/util/test_control.hpp b/ngraph/test/util/test_control.hpp index 58ca0b7bf4d..0c10e117840 100644 --- a/ngraph/test/util/test_control.hpp +++ b/ngraph/test/util/test_control.hpp @@ -16,7 +16,7 @@ namespace ngraph std::string combine_test_backend_and_case(const std::string& backend_name, const std::string& test_casename); -} +} // namespace ngraph #define NGRAPH_GTEST_TEST_CLASS_NAME_(backend_name, test_case_name, test_name) \ backend_name##_##test_case_name##_##test_name##_Test @@ -83,14 +83,14 @@ namespace ngraph test_fixture, \ ::testing::internal::GetTypeId()) -// NGRAPH_TEST_P combined with NGRAPH_INSTANTIATE_TEST_CASE_P facilate the generation -// of value parameterized tests (similar to the original TEST_P and INSTANTIATE_TEST_CASE_P +// NGRAPH_TEST_P combined with NGRAPH_INSTANTIATE_TEST_SUITE_P facilate the generation +// of value parameterized tests (similar to the original TEST_P and INSTANTIATE_TEST_SUITE_P // with the addition of a new 0th parameter for the backend name, which allows nGraph's // manifest controlled unit testing). // // Start by defining a class derived from ::testing::TestWithParam, which you'll pass // for the test_case_name parameter. -// Then use NGRAPH_INSTANTIATE_TEST_CASE_P to define each generation of test cases (see below). +// Then use NGRAPH_INSTANTIATE_TEST_SUITE_P to define each generation of test cases (see below). #define NGRAPH_TEST_P(backend_name, test_case_name, test_name) \ class NGRAPH_GTEST_TEST_CLASS_NAME_(backend_name, test_case_name, test_name) \ : public test_case_name \ @@ -126,59 +126,59 @@ namespace ngraph NGRAPH_GTEST_TEST_CLASS_NAME_(backend_name, test_case_name, test_name)::AddToRegistry(); \ void NGRAPH_GTEST_TEST_CLASS_NAME_(backend_name, test_case_name, test_name)::TestBody() -// Use NGRAPH_INSTANTIATE_TEST_CASE_P to create a generated set of test case variations. +// Use NGRAPH_INSTANTIATE_TEST_SUITE_P to create a generated set of test case variations. // The prefix parameter is a label that you optionally provide (no quotes) for a unique // test name (helpful for labelling a set of inputs and for filtering). // The prefix parameter can be skipped by simply using a bare comma (see example below). // -// Unlike INSTANTIATE_TEST_CASE_P we don't currently support passing a custom param +// Unlike INSTANTIATE_TEST_SUITE_P we don't currently support passing a custom param // name generator. Supporting this with a single macro name requires the use of -// ... and __VA_ARGS__ which in turn generates a warning using INSTANTIATE_TEST_CASE_P +// ... and __VA_ARGS__ which in turn generates a warning using INSTANTIATE_TEST_SUITE_P // without a trailing , parameter. // // Examples: -// NGRAPH_INSTANTIATE_TEST_CASE_P(BACKENDNAME, // backend_name +// NGRAPH_INSTANTIATE_TEST_SUITE_P(BACKENDNAME, // backend_name // , // empty/skipped prefix -// TestWithParamSubClass, // test_case_name +// TestWithParamSubClass, // test_suite_name // ::testing::Range(0, 3) ) // test generator // would generate: // BACKENDNAME/TestWithParamSubClass.test_name/0 // BACKENDNAME/TestWithParamSubClass.test_name/1 // BACKENDNAME/TestWithParamSubClass.test_name/2 // -// NGRAPH_INSTANTIATE_TEST_CASE_P(BACKENDNAME, // backend_name +// NGRAPH_INSTANTIATE_TEST_SUITE_P(BACKENDNAME, // backend_name // NumericRangeTests, // prefix -// TestWithParamSubClass, // test_case_name +// TestWithParamSubClass, // test_suite_name // ::testing::Range(0, 3) ) // test generator // would generate: // BACKENDNAME/NumericRangeTests/BACKENDNAME/TestWithParamSubClass.test_name/0 // BACKENDNAME/NumericRangeTests/BACKENDNAME/TestWithParamSubClass.test_name/1 // BACKENDNAME/NumericRangeTests/BACKENDNAME/TestWithParamSubClass.test_name/2 // -// With the use of NGRAPH_TEST_P and NGRAPH_INSTANTIATE_TEST_CASE_P +// With the use of NGRAPH_TEST_P and NGRAPH_INSTANTIATE_TEST_SUITE_P // the filter to run all the tests for a given backend should be: // --gtest_filter=BACKENDNAME*.* // (rather than the BACKENDNAME.* that worked before the use of NGRAPH_TEST_P) -#define NGRAPH_INSTANTIATE_TEST_CASE_P(backend_name, prefix, test_case_name, generator) \ - static ::testing::internal::ParamGenerator \ - gtest_##prefix##backend_name##test_case_name##_EvalGenerator_() \ +#define NGRAPH_INSTANTIATE_TEST_SUITE_P(backend_name, prefix, test_suite_name, generator) \ + static ::testing::internal::ParamGenerator \ + gtest_##prefix##backend_name##test_suite_name##_EvalGenerator_() \ { \ return generator; \ } \ - static ::std::string gtest_##prefix##backend_name##test_case_name##_EvalGenerateName_( \ - const ::testing::TestParamInfo& info) \ + static ::std::string gtest_##prefix##backend_name##test_suite_name##_EvalGenerateName_( \ + const ::testing::TestParamInfo& info) \ { \ - return ::testing::internal::GetParamNameGen()(info); \ + return ::testing::internal::DefaultParamName(info); \ } \ - static int gtest_##prefix##backend_name##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ + static int gtest_##prefix##backend_name##test_suite_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \ ::testing::UnitTest::GetInstance() \ ->parameterized_test_registry() \ - .GetTestCasePatternHolder( \ - #backend_name "/" #test_case_name, \ + .GetTestCasePatternHolder( \ + #backend_name "/" #test_suite_name, \ ::testing::internal::CodeLocation(__FILE__, __LINE__)) \ - ->AddTestCaseInstantiation( \ + ->AddTestSuiteInstantiation( \ #prefix[0] != '\0' ? #backend_name "/" #prefix : "", \ - >est_##prefix##backend_name##test_case_name##_EvalGenerator_, \ - >est_##prefix##backend_name##test_case_name##_EvalGenerateName_, \ + >est_##prefix##backend_name##test_suite_name##_EvalGenerator_, \ + >est_##prefix##backend_name##test_suite_name##_EvalGenerateName_, \ __FILE__, \ __LINE__) diff --git a/ngraph/test/visitors/op/batch_norm.cpp b/ngraph/test/visitors/op/batch_norm.cpp index 9f5e6e0bda2..72b48e7c5d7 100644 --- a/ngraph/test/visitors/op/batch_norm.cpp +++ b/ngraph/test/visitors/op/batch_norm.cpp @@ -18,12 +18,12 @@ using namespace ngraph; using ngraph::test::NodeBuilder; using ngraph::test::ValueMap; -template +template class BatchNormAttrTest : public ::testing::Test { }; -TYPED_TEST_CASE_P(BatchNormAttrTest); +TYPED_TEST_SUITE_P(BatchNormAttrTest); TYPED_TEST_P(BatchNormAttrTest, batch_norm_inference_op) { @@ -47,10 +47,8 @@ TYPED_TEST_P(BatchNormAttrTest, batch_norm_inference_op) EXPECT_EQ(g_batch_norm->get_eps_value(), batch_norm->get_eps_value()); } -REGISTER_TYPED_TEST_CASE_P( - BatchNormAttrTest, - batch_norm_inference_op); +REGISTER_TYPED_TEST_SUITE_P(BatchNormAttrTest, batch_norm_inference_op); using Types = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes, BatchNormAttrTest, Types); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes, BatchNormAttrTest, Types); diff --git a/ngraph/test/visitors/op/ceiling.cpp b/ngraph/test/visitors/op/ceiling.cpp index 327fb4ac4b3..dc4f32d29b6 100644 --- a/ngraph/test/visitors/op/ceiling.cpp +++ b/ngraph/test/visitors/op/ceiling.cpp @@ -5,7 +5,7 @@ #include "unary_ops.hpp" using Type = ::testing::Types>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_attribute, - UnaryOperatorVisitor, - Type, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Type, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/floor.cpp b/ngraph/test/visitors/op/floor.cpp index be2fb04372b..6393a8295f2 100644 --- a/ngraph/test/visitors/op/floor.cpp +++ b/ngraph/test/visitors/op/floor.cpp @@ -7,7 +7,7 @@ using Types = ::testing::Types, UnaryOperatorType>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_attribute, - UnaryOperatorVisitor, - Types, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/log.cpp b/ngraph/test/visitors/op/log.cpp index 84e87eb6db3..f81d40e7302 100644 --- a/ngraph/test/visitors/op/log.cpp +++ b/ngraph/test/visitors/op/log.cpp @@ -5,7 +5,7 @@ using Types = ::testing::Types, UnaryOperatorType>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_attribute, - UnaryOperatorVisitor, - Types, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/negative.cpp b/ngraph/test/visitors/op/negative.cpp index 769a629fad6..4880c73c0af 100644 --- a/ngraph/test/visitors/op/negative.cpp +++ b/ngraph/test/visitors/op/negative.cpp @@ -7,7 +7,7 @@ using Types = ::testing::Types, UnaryOperatorType>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_attribute, - UnaryOperatorVisitor, - Types, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/reduce_l1.cpp b/ngraph/test/visitors/op/reduce_l1.cpp index a9e9c631871..03ef0f0f77b 100644 --- a/ngraph/test/visitors/op/reduce_l1.cpp +++ b/ngraph/test/visitors/op/reduce_l1.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_l1, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_l1, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_l2.cpp b/ngraph/test/visitors/op/reduce_l2.cpp index 0a592e65c9b..4ace59a9514 100644 --- a/ngraph/test/visitors/op/reduce_l2.cpp +++ b/ngraph/test/visitors/op/reduce_l2.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_l2, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_l2, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_logical_and.cpp b/ngraph/test/visitors/op/reduce_logical_and.cpp index b460be15efc..af149103baa 100644 --- a/ngraph/test/visitors/op/reduce_logical_and.cpp +++ b/ngraph/test/visitors/op/reduce_logical_and.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_logical_and, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_logical_and, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_logical_or.cpp b/ngraph/test/visitors/op/reduce_logical_or.cpp index 265256e3a48..216a3a73ba6 100644 --- a/ngraph/test/visitors/op/reduce_logical_or.cpp +++ b/ngraph/test/visitors/op/reduce_logical_or.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_logical_or, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_logical_or, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_max.cpp b/ngraph/test/visitors/op/reduce_max.cpp index 7cfe9b54f57..713114717f9 100644 --- a/ngraph/test/visitors/op/reduce_max.cpp +++ b/ngraph/test/visitors/op/reduce_max.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_max, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_max, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_mean.cpp b/ngraph/test/visitors/op/reduce_mean.cpp index 2d99381f4f9..382fc2d704f 100644 --- a/ngraph/test/visitors/op/reduce_mean.cpp +++ b/ngraph/test/visitors/op/reduce_mean.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_mean, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_mean, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_min.cpp b/ngraph/test/visitors/op/reduce_min.cpp index 90dcac33ce7..9d212d8cf6b 100644 --- a/ngraph/test/visitors/op/reduce_min.cpp +++ b/ngraph/test/visitors/op/reduce_min.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_min, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_min, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_ops.hpp b/ngraph/test/visitors/op/reduce_ops.hpp index 4c5a165b2bc..d70b498fbf4 100644 --- a/ngraph/test/visitors/op/reduce_ops.hpp +++ b/ngraph/test/visitors/op/reduce_ops.hpp @@ -14,12 +14,12 @@ using namespace ngraph; using ngraph::test::NodeBuilder; using ngraph::test::ValueMap; -template +template class ReduceOpsAttrTest : public ::testing::Test { }; -TYPED_TEST_CASE_P(ReduceOpsAttrTest); +TYPED_TEST_SUITE_P(ReduceOpsAttrTest); TYPED_TEST_P(ReduceOpsAttrTest, reduce_ops) { @@ -43,6 +43,4 @@ TYPED_TEST_P(ReduceOpsAttrTest, reduce_ops) EXPECT_EQ(g_reduce_op->get_keep_dims(), reduce_op->get_keep_dims()); } -REGISTER_TYPED_TEST_CASE_P( - ReduceOpsAttrTest, - reduce_ops); +REGISTER_TYPED_TEST_SUITE_P(ReduceOpsAttrTest, reduce_ops); diff --git a/ngraph/test/visitors/op/reduce_prod.cpp b/ngraph/test/visitors/op/reduce_prod.cpp index 21cb8ff4fc3..2343d69ed74 100644 --- a/ngraph/test/visitors/op/reduce_prod.cpp +++ b/ngraph/test/visitors/op/reduce_prod.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_prod, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_prod, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/reduce_sum.cpp b/ngraph/test/visitors/op/reduce_sum.cpp index aa0414d0987..4caf85b012b 100644 --- a/ngraph/test/visitors/op/reduce_sum.cpp +++ b/ngraph/test/visitors/op/reduce_sum.cpp @@ -5,4 +5,4 @@ #include "reduce_ops.hpp" using Type = ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(attributes_reduce_sum, ReduceOpsAttrTest, Type); +INSTANTIATE_TYPED_TEST_SUITE_P(attributes_reduce_sum, ReduceOpsAttrTest, Type); diff --git a/ngraph/test/visitors/op/result.cpp b/ngraph/test/visitors/op/result.cpp index 27e0e45e891..8adbe76321b 100644 --- a/ngraph/test/visitors/op/result.cpp +++ b/ngraph/test/visitors/op/result.cpp @@ -7,7 +7,7 @@ using Types = ::testing::Types, UnaryOperatorType>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_attribute, - UnaryOperatorVisitor, - Types, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/softplus.cpp b/ngraph/test/visitors/op/softplus.cpp index e5ff77e3a4e..6f0134b5a82 100644 --- a/ngraph/test/visitors/op/softplus.cpp +++ b/ngraph/test/visitors/op/softplus.cpp @@ -6,7 +6,7 @@ using Types = ::testing::Types>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_atrribute, - UnaryOperatorVisitor, - Types, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/sqrt.cpp b/ngraph/test/visitors/op/sqrt.cpp index 1df6ae6420a..7bedbe3d28a 100644 --- a/ngraph/test/visitors/op/sqrt.cpp +++ b/ngraph/test/visitors/op/sqrt.cpp @@ -6,7 +6,7 @@ using Types = ::testing::Types, UnaryOperatorType>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_attribute, - UnaryOperatorVisitor, - Types, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/squeeze.cpp b/ngraph/test/visitors/op/squeeze.cpp index 9c6813af16f..5a14b08864c 100644 --- a/ngraph/test/visitors/op/squeeze.cpp +++ b/ngraph/test/visitors/op/squeeze.cpp @@ -4,9 +4,9 @@ #include "unary_ops.hpp" using Types = ::testing::Types, - UnaryOperatorType>; + UnaryOperatorType>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_attribute, - UnaryOperatorVisitor, - Types, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/swish.cpp b/ngraph/test/visitors/op/swish.cpp index 0cb39f353cd..8bfc74c0e5d 100644 --- a/ngraph/test/visitors/op/swish.cpp +++ b/ngraph/test/visitors/op/swish.cpp @@ -5,7 +5,7 @@ using Type = ::testing::Types>; -INSTANTIATE_TYPED_TEST_CASE_P(visitor_without_atrribute, - UnaryOperatorVisitor, - Type, - UnaryOperatorTypeName); +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_atrribute, + UnaryOperatorVisitor, + Type, + UnaryOperatorTypeName); diff --git a/ngraph/test/visitors/op/unary_ops.hpp b/ngraph/test/visitors/op/unary_ops.hpp index 16764c42a7c..7bf588b5231 100644 --- a/ngraph/test/visitors/op/unary_ops.hpp +++ b/ngraph/test/visitors/op/unary_ops.hpp @@ -40,7 +40,7 @@ public: } }; -TYPED_TEST_CASE_P(UnaryOperatorVisitor); +TYPED_TEST_SUITE_P(UnaryOperatorVisitor); TYPED_TEST_P(UnaryOperatorVisitor, No_Attribute_4D) { @@ -56,4 +56,4 @@ TYPED_TEST_P(UnaryOperatorVisitor, No_Attribute_4D) EXPECT_EQ(builder.get_value_map_size(), expected_attr_count); } -REGISTER_TYPED_TEST_CASE_P(UnaryOperatorVisitor, No_Attribute_4D); +REGISTER_TYPED_TEST_SUITE_P(UnaryOperatorVisitor, No_Attribute_4D);