From 95e6f909d2a7a37bf76432af0fdb100e398e28e0 Mon Sep 17 00:00:00 2001 From: vurusovs Date: Mon, 25 Dec 2023 16:05:33 +0400 Subject: [PATCH] Port `version.cpp` and remove legacy --- .../behavior/ov_plugin/version.cpp | 23 ++++++++ .../behavior/plugin/version.cpp | 18 ------- .../behavior/plugin/version.cpp | 18 ------- .../behavior/ov_plugin/version.cpp | 23 ++++++++ .../behavior/plugin/version.cpp | 16 ------ .../behavior/ov_plugin/version.cpp | 18 +++++++ .../behavior/plugin/version.cpp | 18 ------- .../include/behavior/plugin/version.hpp | 54 ------------------- 8 files changed, 64 insertions(+), 124 deletions(-) create mode 100644 src/plugins/auto/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp delete mode 100644 src/plugins/auto/tests/functional/shared_tests_instances/behavior/plugin/version.cpp delete mode 100644 src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp create mode 100644 src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp delete mode 100644 src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp create mode 100644 src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp delete mode 100644 src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/version.cpp delete mode 100644 src/tests/functional/plugin/shared/include/behavior/plugin/version.hpp diff --git a/src/plugins/auto/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp b/src/plugins/auto/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp new file mode 100644 index 00000000000000..1dd421bcb59df0 --- /dev/null +++ b/src/plugins/auto/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp @@ -0,0 +1,23 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "behavior/ov_plugin/version.hpp" + +namespace ov { +namespace test { +namespace behavior { + +INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests, + VersionTests, + ::testing::Values(ov::test::utils::DEVICE_MULTI), + VersionTests::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, + VersionTests, + ::testing::Values(ov::test::utils::DEVICE_AUTO), + VersionTests::getTestCaseName); + +} // namespace behavior +} // namespace test +} // namespace ov diff --git a/src/plugins/auto/tests/functional/shared_tests_instances/behavior/plugin/version.cpp b/src/plugins/auto/tests/functional/shared_tests_instances/behavior/plugin/version.cpp deleted file mode 100644 index 796149e7cb1e76..00000000000000 --- a/src/plugins/auto/tests/functional/shared_tests_instances/behavior/plugin/version.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "behavior/plugin/version.hpp" - -using namespace BehaviorTestsDefinitions; -namespace { -INSTANTIATE_TEST_SUITE_P(smoke_Multi_BehaviorTests, - VersionTest, - ::testing::Values(ov::test::utils::DEVICE_MULTI), - VersionTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Auto_BehaviorTests, - VersionTest, - ::testing::Values(ov::test::utils::DEVICE_AUTO), - VersionTest::getTestCaseName); -} // namespace diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp deleted file mode 100644 index bcc0130ca8e8ab..00000000000000 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "behavior/plugin/version.hpp" - -using namespace BehaviorTestsDefinitions; -namespace { - INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, VersionTest, - ::testing::Values(ov::test::utils::DEVICE_CPU), - VersionTest::getTestCaseName); - - INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, VersionTest, - ::testing::Values(ov::test::utils::DEVICE_HETERO), - VersionTest::getTestCaseName); - - -} // namespace diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp new file mode 100644 index 00000000000000..6109f54819cce8 --- /dev/null +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp @@ -0,0 +1,23 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "behavior/ov_plugin/version.hpp" + +namespace ov { +namespace test { +namespace behavior { + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + VersionTests, + ::testing::Values(ov::test::utils::DEVICE_GPU), + VersionTests::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, + VersionTests, + ::testing::Values(ov::test::utils::DEVICE_HETERO), + VersionTests::getTestCaseName); + +} // namespace behavior +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp deleted file mode 100644 index 00fd89116bb52b..00000000000000 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/plugin/version.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "behavior/plugin/version.hpp" - -using namespace BehaviorTestsDefinitions; -namespace { -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, VersionTest, - ::testing::Values(ov::test::utils::DEVICE_GPU), - VersionTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests, VersionTest, - ::testing::Values(ov::test::utils::DEVICE_HETERO), - VersionTest::getTestCaseName); -} // namespace diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp new file mode 100644 index 00000000000000..1d2a49c29ff525 --- /dev/null +++ b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/version.cpp @@ -0,0 +1,18 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "behavior/ov_plugin/version.hpp" + +namespace ov { +namespace test { +namespace behavior { + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + VersionTests, + ::testing::Values(ov::test::utils::DEVICE_TEMPLATE), + VersionTests::getTestCaseName); + +} // namespace behavior +} // namespace test +} // namespace ov diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/version.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/version.cpp deleted file mode 100644 index 7fa154c1b86b1a..00000000000000 --- a/src/plugins/template/tests/functional/shared_tests_instances/behavior/plugin/version.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "behavior/plugin/version.hpp" - -using namespace BehaviorTestsDefinitions; - -namespace { - -const std::vector> configs = {{}}; - -INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, - VersionTest, - ::testing::Values(ov::test::utils::DEVICE_TEMPLATE), - VersionTest::getTestCaseName); - -} // namespace diff --git a/src/tests/functional/plugin/shared/include/behavior/plugin/version.hpp b/src/tests/functional/plugin/shared/include/behavior/plugin/version.hpp deleted file mode 100644 index 463266084624a8..00000000000000 --- a/src/tests/functional/plugin/shared/include/behavior/plugin/version.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include -#include "common_test_utils/test_assertions.hpp" -#include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" -#include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" -#include "ie_preprocess.hpp" -#include "base/behavior_test_utils.hpp" - -namespace BehaviorTestsDefinitions { -class VersionTest : public testing::WithParamInterface, - public BehaviorTestsUtils::IEPluginTestBase { -public: - static std::string getTestCaseName(testing::TestParamInfo obj) { - std::string targetDevice; - std::map config; - targetDevice = obj.param; - std::replace(targetDevice.begin(), targetDevice.end(), ':', '_'); - std::ostringstream result; - result << "targetDevice=" << targetDevice; - return result.str(); - } - - void SetUp() override { - target_device = this->GetParam(); - SKIP_IF_CURRENT_TEST_IS_DISABLED() - APIBaseTest::SetUp(); - } - - std::shared_ptr ie = PluginCache::get().ie(); -}; - -// Load unsupported network type to the Plugin -TEST_P(VersionTest, pluginCurrentVersionIsCorrect) { - if (target_device.find(ov::test::utils::DEVICE_AUTO) == std::string::npos && - target_device.find(ov::test::utils::DEVICE_MULTI) == std::string::npos && - target_device.find(ov::test::utils::DEVICE_HETERO) == std::string::npos) { - std::map versions = ie->GetVersions(target_device); - ASSERT_EQ(versions.size(), 1); - ASSERT_EQ(versions.begin()->first, target_device); - auto version = versions.begin()->second; - IE_SUPPRESS_DEPRECATED_START - ASSERT_EQ(version.apiVersion.major, 2); - ASSERT_EQ(version.apiVersion.minor, 1); - IE_SUPPRESS_DEPRECATED_END - } -} -} // namespace BehaviorTestsDefinitions